text:
Terms and Conditions	admin	2019-08-06T14:33:18+00:00
Terms and conditions for the purchase of metals for recycling
1.1 Definitions:
"Acceptance Criteria": the acceptance criteria specified by the Customer from time to time in respect of Goods which are bulk ferrous metals.
"Business Day": a day (other than a Saturday, Sunday or public holiday) when banks in London are open for business.
"Conditions": the terms and conditions set out in this document as amended from time to time in accordance with condition 12.3.
"Contract": the contract between the Customer and the Supplier for the sale and purchase of the Goods in accordance with these Conditions.
"Customer": S. Norton & Co. Limited (registered in England and Wales with company number 01859428).
"Delivery": delivery of the Goods in accordance with condition 4.4 and cognate expressions shall be interpreted accordingly.
"Delivery Date": the date on which the Goods arrive at the Delivery Location.
"Delivery Location": the Customer's site.
"Goods": the goods (or any part of them).
"Mandatory Policies": the Customer's policies listed in Schedule 1. Copies of these policies are available from the Customer on request.
"Non-conforming Materials": Goods which do not conform to the acceptance criteria specified from time to time by the Customer and/or the British Metals Recycling Association and/or in respect of which the Customer shall be entitled to charge sums in addition to the price for appropriate administration and safe handling/waste treatment. 2
"Supplier": the person or firm from whom the Customer purchases the Goods.
"Waste Transfer Note": the written report generated by the Customer following Delivery (save where Delivery is effected by ship into the Delivery Location) specifying the quantity, weight, European Waste Code and description of the Goods, the cost of weighing and/or testing the Goods and the price which the Customer is prepared to pay for them.
1.2 Interpretation:
(a) a reference to a statute or statutory provision is a reference to such statute or provision as amended or re-enacted. A reference to a statute or statutory provision includes any subordinate legislation made under that statute or statutory provision, as amended or re-enacted;
(b) any phrase introduced by the terms including, include, in particular or any similar expression shall be construed as illustrative and shall not limit the sense of the words preceding those terms; and
(c) a reference to writing or written includes emails.
2. Basis of contract
2.1 These Conditions apply to the Contract and to each Delivery to the exclusion of any other terms that the Supplier seeks to impose or incorporate, or which are implied by trade, custom, practice or course of dealing.
2.2 Each Delivery constitutes an offer by the Supplier to sell the Goods to the Customer upon these Conditions.
2.3 The Contract shall come into existence upon generation by the Customer of the Waste Transfer Note, or, in respect of Goods effected by ship into the Delivery Location, upon notification by the Customer by email to the Supplier of the weight discharged from the vessel.
2.4 The Supplier waives any right it might otherwise have to rely on any term endorsed upon, delivered with or contained in any documents of the Supplier that is inconsistent with these Conditions.
3. The Goods
3.1 The Supplier shall ensure that the Goods shall:
(a) correspond with their description as notified to the Customer at or before Delivery;
(b) comply with all applicable statutory and regulatory requirements relating to the Goods;
(c) not consist of any Non-conforming Materials; and
(d) where applicable, meet the Acceptance Criteria.
3.2 The Supplier shall ensure that at all times it has and maintains all the licences, permissions, authorisations, consents and permits that it needs to carry out its obligations under the Contract, including a waste management licence, scrap metal dealer's licence and waste carrier's licence, and will produce copies of these to the Customer upon request.
3.3 If following Delivery the Customer considers that the Goods do not conform with condition 3.1, the Customer may charge the Supplier an additional fee for the disposal of the non-compliant element of the Goods. This fee will be that sum which equals the value that would have been payable for such elements of the Goods had it conformed with condition 3.1 multiplied by the following applicable percentage, namely:
(a) in respect of non-ferrous Goods, 100%;
(b) in respect of ferrous Goods, 200%.
Such additional fee may be deducted by the Customer from such value of the Goods in question.
3.4 Without prejudice to condition 3.3, the Supplier shall in addition pay to the Customer its charges as specified by the Customer from time to time in respect of:
(a) any Non-conforming Materials; and/or
(b) any Goods which fail to meet the Acceptance Criteria.
3.5 In the event of any dispute between the parties as to whether the Goods comply with condition 3.1, the matter may be referred by either party for determination by an independent expert ("Expert") jointly appointed by the parties or in event of the failure of both parties to agree such joint appointment, as appointed by the President for the time being of the British Metals Recycling Association upon the application of either party. The Expert shall act as an expert and not as an arbitrator. The Supplier and the Customer will co-operate with the expert in enabling her/him to reach a decision. The Expert's decision shall be final and binding on the Supplier and the Customer in the absence of manifest error. Each party shall bear its own costs in relation to the reference to the Expert. The Expert's fees shall be borne in such proportions as the Expert determines or, in the absence of such determination, by the Supplier and the Customer in equal shares.
4.1 The Supplier shall ensure that:
(a) the Goods are properly packed, loaded and secured in such manner as to enable them to reach the Delivery Location in good condition under normal conditions of transportation and shall either be delivered by the Supplier at or despatched for Delivery to the Delivery Location or made available by the Supplier for collection by or on behalf of the Customer at the location and in the manner agreed with the Customer ("Collection Location") for delivery to the Delivery Location;
(b) save in respect of deliveries effected by ship to the Delivery Location, each delivery of the Goods is accompanied by the Supplier's own waste transfer note; The Supplier shall ensure the accuracy of such waste transfer note and shall supply a copy of it to the Customer upon Delivery; and
(c) the Goods are not exposed unnecessarily to wet conditions, including ice and/or snow during transportation to the Delivery Location or the Collection Location, as the case may be, so as not to affect the weight of the load.
4.2 Where the Supplier delivers the Goods to the Delivery Location, it shall do so during the Customer's normal business hours, or as otherwise instructed by the Customer.
4.3 Where the Goods are to be collected by or on behalf of the Customer at the Collection Location, the Supplier shall ensure that the Goods are made available for collection at the Collection Location at the time agreed with the Customer.
4.4 Delivery of the Goods shall be completed on the completion of unloading by the Customer or the Supplier (as the case may be) of the Goods at the Delivery Location and (where applicable) the generation of the Waste Transfer Note.
4.5 The Customer shall in no event be responsible for returning any packages, bags, drums or containers delivered to the Customer or for the cost thereof.
5. Title and risk
5.1 Title and risk in the Goods shall pass to the Customer on completion of Delivery. Until such time, the Goods shall remain at the risk of the Supplier and the Supplier shall keep the Goods insured against the risk of loss or damage and ensure that the Customer's interest is noted on the insurance policy.
6.1 Subject to condition 6.2, the price of the Goods shall be the price for that grade of Goods that was last notified by email by the Customer to the Supplier.
6.2 The price of the Goods in respect of which Delivery is effected by ship into the Delivery Location shall be as notified by the Customer for that shipment by email to the Supplier.
6.3 The price of the Goods excludes amounts in respect of value added tax (VAT), which the Customer shall where applicable additionally be liable to pay to the Supplier at the prevailing rate, subject to the receipt of a valid VAT invoice but includes the costs of Delivery, packaging, insurance and carriage of the Goods.
6.4 The Supplier may invoice (or procure the generation of an invoice on its behalf by the Customer where the Supplier is a self-billing supplier of the Customer) the Customer for the price of the Goods plus any VAT that is payable on or at any time after receipt of the Waste Transfer Note or, in the case of Goods delivered by ship, email confirmation of the discharged weight from the Customer. The Supplier shall ensure that the invoice includes the date of the Delivery, the waste transfer note number in the case of Goods that are delivered by road, the invoice number, the Supplier's VAT registration number and any supporting documents that the Customer may reasonably require. The Customer shall pay correctly rendered invoices within 30 days of receipt of the invoice. Payment shall be made to the bank account nominated in writing by the Supplier.
6.5 If a party fails to make any payment due to the other under the Contract by the due date for payment, then the defaulting party may be charged interest on the overdue amount at Barclays Bank plc base rate. This clause shall not apply to payments the defaulting party disputes in good faith.
6.6 The Customer may at any time, without limiting any of its other rights or remedies, set off any liability of the Supplier to the Customer against any liability of the Customer to the Supplier.
6.7 If the Supplier fails to comply with any of its obligations under these conditions the Customer shall be entitled to withhold payment of the price.
7.1 The Supplier shall keep the Customer indemnified against all liabilities, costs, expenses, damages and losses (including but not limited to any direct, indirect or consequential losses, loss of profit, loss of reputation and all interest, penalties and legal costs (calculated on a full indemnity basis) and all other professional costs and expenses) suffered or incurred by the Customer as a result of or in connection with:
(a) any claim made against the Customer for actual or alleged infringement of a third party's intellectual property rights arising out of or in connection with the supply or use of the Goods, to the extent that the claim is attributable to the acts or omissions of the Supplier, its employees, agents or subcontractors;
(b) any claim made against the Customer by a third party for death, personal injury or damage to property arising out of or in connection with defects in or the constituency of the Goods, including any claims in relation to damage caused by the Goods in transit to the Delivery Location;
(c) any claim made against the Customer by a third party arising out of or in connection with the supply of the Goods, to the extent that such claim arises out of the breach, negligent performance or failure or delay in performance of the Contract by the Supplier, its employees, agents or subcontractors;
(d) any claim made against the Customer by a third party for death, personal injury or damage to property arising out of or in connection with any Non-conforming Materials being delivered to the Customer by the Supplier; and
(e) any losses suffered by the Customer arising out of or in connection with any Non-conforming Materials being delivered to the Customer by the Supplier.
7.2 This condition 7 shall survive termination of the Contract.
The Supplier shall maintain in force, with a reputable insurance company, product liability insurance and public liability insurance to cover the liabilities that may arise under or in connection with the Contract with minimum cover of £5 million for any one claim for both product and public liability, and shall, on the Customer's request, produce both the insurance certificate giving details of cover and the receipt for the current year's premium in respect of each insurance.
9. Compliance with relevant laws and policies
9.1 In performing its obligations under the Contract, the Supplier shall:
(a) comply with all applicable laws, statutes, regulations from time to time in force including money laundering regulations; and
(b) comply with the Mandatory Policies.
9.2 The Customer may immediately terminate the Contract for any breach of this condition 9.
10.1 Without limiting its other rights or remedies, the Customer may terminate the Contract with immediate effect by giving written notice to the Supplier if:
(a) the Supplier commits a material breach of any term of the Contract and (if such a breach is remediable) fails to remedy that breach within seven days of that party being notified in writing to do so;
(b) the Supplier takes any step or action in connection with its entering administration, provisional liquidation or any composition or arrangement with its creditors (other than in relation to a solvent restructuring), being wound up (whether voluntarily or by order of the court, unless for the purpose of a solvent restructuring), having a receiver appointed to any of its assets or ceasing to carry on business or, if the step or action is taken in another jurisdiction, in connection with any analogous procedure in the relevant jurisdiction;
(c) the Supplier takes any step or action in connection with the Supplier being made bankrupt, entering any composition or arrangement with his creditors, having a receiver appointed to any of his assets, or ceasing to carry on business or if the step or action is taken in another jurisdiction, in connection with any analogous procedure in the relevant jurisdiction;
(d) the Supplier suspends, or threatens to suspend, or ceases or threatens to cease to carry on all or a substantial part of its business; or
(e) the Supplier's financial position deteriorates to such an extent that in the Customer's opinion the Supplier's capability to adequately fulfil its obligations under the Contract has been placed in jeopardy.
10.2 Termination of the Contract, however arising, shall not affect any of the parties' rights and remedies that have accrued as at termination.
10.3 Clauses that expressly or by implication survive termination of the Contract shall continue in full force and effect.
The Customer shall not be in breach of the Contract or liable for delay in performing, or failure to perform, any of its obligations under it if such delay or failure results from an event, circumstance or cause beyond its reasonable control. If the period of delay or non-performance continues for more than four weeks, the Customer may terminate the Contract by giving seven days' written notice of termination to the Supplier.
12.1 Assignment and other dealings
(a) The Customer may at any time assign, transfer, mortgage, charge, subcontract or deal in any other manner with any or all of its rights or obligations under the Contract.
(b) The Supplier may not assign, transfer, mortgage, charge, subcontract, declare a trust over or deal in any other manner with any or all of its rights or obligations under the Contract without the prior written consent of the Customer.
12.2 Entire agreement. The Contract constitutes the entire agreement between the parties and supersedes and extinguishes all previous agreements, promises, assurances, warranties, representations and understandings between them, whether written or oral, relating to its subject matter.
12.3 Variation. Except as set out in these Conditions, no variation of the Contract, including the introduction of any additional terms and conditions, shall be effective unless it is agreed in writing and signed by the Customer.
12.4 Waiver. Except as set out in condition 2.4, no failure or delay by a party to exercise any right or remedy provided under the Contract or by law shall constitute a waiver of that or any other right or remedy, nor shall it prevent or restrict the further exercise of that or any other right or remedy. No single or partial exercise of such right or remedy shall prevent or restrict the further exercise of that or any other right or remedy.
12.5 Severance. If any provision or part-provision of the Contract is or becomes invalid, illegal or unenforceable, it shall be deemed modified to the minimum extent necessary to make it valid, legal and enforceable. If such modification is not possible, the relevant provision or part-provision shall be deemed deleted. Any modification to or deletion of a provision or part-provision under this clause shall not affect the validity and enforceability of the rest of the Contract.
12.6 Notices.
(a) Any notice or other communication given to a party under or in connection with the Contract shall be in writing, addressed to that party at its registered office (if it is a company) or its principal place of business (in any other case) or such other address as that party may have specified to the other party in writing in accordance with this clause, and shall be delivered personally, or sent by pre-paid first class post or other next working day delivery service, commercial courier, or email.
(b) A notice or other communication shall be deemed to have been received: if delivered personally, when left at the address referred to in condition 12.6(a); if sent by pre-paid first class post or other next working day delivery service, at 9.00 am on the second Business Day after posting; if delivered by commercial courier, on the date and at the time that the courier's delivery receipt is signed; or, if sent by email, one Business Day after transmission.
(c) This clause does not apply to the service of any proceedings or other documents in any legal action, or other method of dispute resolution.
12.7 Third party rights. No one other than a party to the Contract and their permitted assignees shall have any right to enforce any of its terms.
12.8 Governing law. The Contract, and any dispute or claim (including non-contractual disputes or claims) arising out of or in connection with it or its subject matter or formation, shall be governed by and construed in accordance with the law of England and Wales.
12.9 Jurisdiction. Each party irrevocably agrees that the courts of England and Wales shall have exclusive jurisdiction to settle any dispute or claim (including non-contractual disputes or claims) arising out of or in connection with the Contract or its subject matter or formation.
Customer's Mandatory Policies
▪ Anti-Bribery Policy
▪ Ethics Policy


text:
Q: PathRemoveFileSpecA deprecated: What to use instead? Right now, I have:

*

*GetModuleFileNameA to get the executable that has loaded my DLL as a charstring

*MapAndLoad, which only accepts charstrings, to look at that executable's metadata

I want to remove the filename and just get the directory of the executable, so I can load a DLL that's specifically in the same directory. Yet, PathCchRemoveFileSpec doesn't take charstrings. What do I do?

redpajama_set_name: RedPajamaStackExchange


text:
Tapping Into 'Conscious Chooser' Behaviors: Q&A With Jascha Kaykas-Wolff, CMO Of Mozilla
Aaron Kwittken Contributor
A purpose-driven entrepreneur and podcaster, I'm an expert in reputation management who writes about how companies and leaders communicate in good times and bad.
Jascha Kaykas-Wolff - Mozilla, Chief Marketing Officer
Christopher Michel
At a time when internet privacy issues have reached the highest levels of governmental and cultural debate, Mozilla remains an advocate for the open internet and a protector of privacy. While Mozilla's Firefox has global recognition, not-for-profit Mozilla faces the challenge of marketing the "intangibles" of security and privacy protection. I spoke with Mozilla's Chief Marketing Officer Jascha Kaykas-Wolff about how their audience research uncovered the "conscious chooser" demographic and how they're applying this to marketing Mozilla's brand value and external offerings.
Aaron Kwittken: You joined Mozilla in almost three years ago, and before that, you spent time at Microsoft and Yahoo. What attracted you to Mozilla? Did it feel like the culmination of a number of things you've learned throughout the course of your career?
Jascha Kaykas-Wolff: I've worked in marketing for about twenty years, and started my career intending to do something completely different than what I do today. I began working as a Product Manager at Yahoo and at Microsoft, where I unintentionally took over building the marketing team. As the least technical person amongst the founders of the Microsoft Store, I took on the role of marketing. Two threads quickly emerged that I believe brought me to where I am today. Starting as a product person, I didn't understand the processes that marketing worked within. They seemed opaque and it was hard to understand what prioritization looked like. Without knowing better, I began applying many of the practices I was investigating, in particular, agile marketing practices. Additionally, the data in the marketing group wasn't great, and I wanted analytical, quantitative information to inform our decision-making. I began exploring how to better interact with customers by collecting data with their permission and then use that data to make smarter decisions.
Over the last decade, a more emotional part of me started to expose itself professionally. In many cases, my organizations weren't trying to make the best decision on behalf of our customers. Instead, we were trying to meet financial objectives. While there's nothing wrong with that, something didn't feel right when we weren't consistently prioritizing the best decisions for our customers and users.
When I met the CEO of the team here, it felt as though the missing piece in my career had been found. Mozilla also has an organizational structure and an economic system that reinforces those ideals. That's the aspect of the business I find most fascinating. We operate as a not-for-profit, but we also care about both sustainability and revenue – when push comes to shove we're always going to make the decisions that we think will most positively impact our users.
Kwittken: I imagine that as you talk about values and challenges, the last month has probably been challenging. You just released your new product Quantum, but you also took some heat over the Mr. Robot promotion, which I think was misunderstood. Can you about how you worked through that?
Kaykas-Wolff: The release of Quantum came from matching the needs of our users. In order to understand these needs, we spent time with our users to understand the exact features they needed, what we weren't giving to them and what they weren't getting from the competitive set of products out there. This was critical to the success of the Quantum launch.
In truth, that's also how we responded to seeing our users' reaction to our collaboration with Mr. Robot. It didn't go how we wanted it to, and we are deeply sorry that it didn't. I'll say, though, that the response our team had after hearing user feedback was to respond within a matter of hours, and is absolutely representative of the kind of organization I'm proud to be a part of. When I think about the Quantum release, the promotion with Mr. Robot and even the work we did earlier this month with Spectre bugs, our responses demonstrated how we are focused on doing what's best for our users, especially when it requires us to change the course we're on. We believe that's a healthy part of how customer relationships should work.
Kwittken: Do you feel that customers realize that you're not-for-profit and you're purely mission-driven?
Kaykas-Wolff: This is actually one of the biggest challenges - and opportunities - that we have as a marketing organization at Mozilla. When I joined three years ago, we kicked off a substantive amount of user research. We wanted to understand how the Mozilla and Firefox brands were understood, and the perceived relationship between both. We found that Firefox has strong unaided awareness globally and incredibly strong unaided awareness in the technology category. That being said, Mozilla has very little awareness as a brand globally, compared to Firefox. What was striking for us is that those who said they knew Mozilla didn't actually know that it was related to Firefox and how both pieces work together.
By digging into this further, we found users that understood Mozilla well and oftentimes donated to Mozilla for the cause, also understood that Mozilla built Firefox and happened to self-identify as our most active users of Firefox. This virtuous cycle type of relationship between the brand Mozilla, the understanding of the mission of Mozilla, and the usage of Firefox, is something we never tapped into. We're starting to invest more into the brand of Mozilla, because we've found when people understand Mozilla they have an even higher likelihood of using Firefox. The idea that we're non-for profit is important in creating distinction for the brand of Mozilla, but the connection between the Mozilla brand and Firefox is equally important for us.
Kwittken: I'm sure you've heard about the studies or speculation saying that people who use Firefox or Chrome are smarter or have better job performance. What do you say to that?
Kaykas-Wolff: It's really fascinating. We've done research to help us create a target audience segment that we're building our products for and are marketing to, and we've heard anecdotes like these studies surround this target segment over the course of the last couple years. Our research led us to the idea of the 'millennial mindset,' which encapsulates the idea that this group cares more about how their choices, such as buying products or services, reflect their individual values. We call this group of people that have the core millennial mindset the "conscious chooser." The conscious chooser is a group of people around the world who go out of their way to make decisions on purpose, and they do so because they believe the products and services they use can be a reflection of their own personal values.
If they're going out of their way to pick something that relates to their values, they're probably going to show up differently in all aspects of life: the way they work, the way they contribute in the classroom or in the community. If you choose a product such as Firefox, you have to go out of your way to get it because it's not set as a default. That trend of the "conscious chooser" is important to our marketing strategy and it absolutely relates to some of these anecdotes.
Kwittken: Last question for you, regarding The Glass Room. Can you talk a little bit about the impetus behind it, as well as the behind the scenes process of selling it in internally?
Kaykas-Wolff: The Glass Room has now been running for almost three years. It started as an idea in Berlin, Germany, and it has run in New York and now London. It stems from one central theme behind all of the work that we do in marketing at Mozilla, which is making our very intangible products and ideas tangible. In fact, our marketing mix over the course of the last three years has shifted much more heavily into the events space because of that theme.
The Glass Room is core to one of our main pillars supporting the brand of Mozilla. Mozilla is all about supporting people's privacy and security when it comes to the internet, which we've found is a shutdown topic for a mass media audience. We have been looking for different ways to get people and press interested in it. We met a group of artists in Berlin who ran an exhibition that tried to demonstrate these themes and the decisions we make for our online experiences. We wanted to expose their works to much bigger audiences through the Mozilla lens, hence The Glass Room.
For us, the sell wasn't difficult. The challenge was, how do we take the idea and make it into something that is meaningful? The turning point was exploring how we could create a retail experience with our partners, and this was critical in getting both consumer adoption and press interest. The Glass Room in New York, as our first deposit, had such a positive response from a communications perspective, that it gave us confidence that we could continue to invest in it, which is why we recently brought it to London. We're proud of the work. We believe it hits on many of the brand tenants we care about and have seen an incredible public response. As long as we continue to see that response, we'll continue to make these investments. It's a part of the agile philosophy that we have: when something works, keep investing in it.
Aaron Kwittken
Aaron is founder and CEO of the award-winning brand and PR agency KWT Global and creator/host of the popular Brand on Purpose podcast, with offices in New York, Londo...

redpajama_set_name: RedPajamaCommonCrawl


text:
Higgins armory museum
The amish store balderson
Best buy blakc friday
Detailing a car means
Akadema baseball gloves
Rubber inner tubes
School of Swordplay open-ended class Tuesday and Thursday evenings 6:30-8:00pm Saturday mornings 10:30am-12noon at Higgins Armory Museum.If you have a specific need, I will be happy to custom...
The Age of Armor: from the Higgins Armory Musuem
All together the collection at the Higgins Armory Museum is about 4,000 pieces.
Higgins Armory Overnight - Cub Scout Pack 97 - Hopkinton, MA
The project focused on the German, Italian, Spanish, and French martial arts during their respective periods of prominence, using mainly primary sources.
John W. Higgins Armory Llc in Worcester, Ma : Contact
The only dedicated museum of armor in the western hemisphere.
Worcester Art Museum's show of armor shines, surprises
March 11, 2013 — Unable to chart a course for long-term financial sustainability, the Higgins Armory Museum in Worcester announced that it will close at the end of 2013 and transfer its collection of arms and armor, widely regarded as one of the three most significant collections of its type in the Americas, to the Worcester Art Museum. The Higgins Armory Museum in Worcester announced on Friday, March 8 that it will close its museum on Dec. 31, 2013 and transfer its collection of arms and armor to the Worcester Art Museum.
Higgins Armory Museum to close at the end of 2013
Hosted By: Higgins Armory Museum See, live and in-person, the toys that knights played with during our week of presentations, workshops, and interactive experiences.
World Heritage Encyclopedia, the aggregation of the largest online encyclopedias available, and the.Higgins started the construction of the steel and glass building in 1929 for it to be used for his armory collection.
Schoot Vacation Week at the Higgins :: Events.org
The Higgins Armoury Museum, which closed at the end of 2013, was set within an Art Deco pseudo-castle. Higgins Armory Museum is a non-profit museum, located in Worcester, Massachusetts,dedicated to the display of arms and armor.
Higgins Armory Museum Jobs with Remote, Part-Time or
With the lowest hotel rates in town, Agoda.com offers many lodging options a short distance away from Museums and Art Galleries.Contact us for Availability 603-641-8608 ask for Brian John W. Quick Description: Higgins Armory Museum, located in Worcester, Massachusetts, housed in a steel Art Deco Building, is the sole museum in the Western Hemisphere devoted to arms and armour.
Hotels Near Higgins Armory Museum - Higgins Armory Museum Massachusetts.
About Higgins Armory - Storm The Castle
"WPI save our treasures IQP -- The Higgins Armory Museum
A recent practice session: Fundamentals of Viking Age Sword and Shield Combat: Promotional Videos for Higgins Armory Museum: 30 sec promotional video for.
Higgins Armory Sword Guild
The Higgins Armory Museum was a non-profit museum located in Worcester, Massachusetts,.
An Institutional History of the Higgins Armory Museum and Its Relationship with Worcester, Massachusetts by Kary A.
Construction was completed in 1931 and was named The Museum of Steel and Armor. Leland, was founded in 1931 by John Woodman Higgins on the site of the Worcester Pressed Steel Company. The Higgins Armory Museum has around 60,000 visitors each year providing them the opportunity to view and learn about its vast collection of armor as well as a community outreach program.
Higgins Armory building in Worcester sold to New Hampshire
Reverd nation
Things to in nyc
Billy blanks bootcamp
Atlanta zipline
Vacation packages to mexico
Aaa rent a car discounts
Healthy deodorant
Washington mall cinemas


D.C. Law Library - § 8–111.02. Asbestos worker license.
↪ § 8–111.02. Asbestos worker license.
(3) Complied with other standards required for licensure by the Non-Health Related Professions and Occupations Licensure Act of 1998.
(b) An asbestos worker license shall expire 2 years from the date of issuance. A license may be renewed for additional 2-year periods if the asbestos worker submits a renewal application with the renewal fee to the Mayor.
"The Non-Health Related Professions and Occupations Licensure Act of 1998," referenced in (a)(3), is title I of D.C. Law 12-261.


text:
Toronto Developer Shares How His App Ended Up in an iPhone Ad
by Usman Qureshi – Mon, March 30, 2015
Robleh Jama, the Toronto-based iOS developer and founder of Tiny Hearts, has shared the details of Apple's selection process in an article on Fast Company, revealing how getting featured in an ad by the iPhone maker isn't simply a matter of luck, especially for his app Quick Fit: 7 Minute Workout (via MacStories).
Jama writes that it all began when he received an email from Apple's outside ad agency TBWA\Media Arts informing him that his app was being considered for a broadcast commercial, though they told him there were no guarantees about his app making it into the final spot. "I signed the required paperwork and then tried really hard not to think about this or get my hopes up for the next couple of months", he says.
"Then word arrived in my email box: Our app had made the international spot. I let out a huge sigh of relief". The developer notes that the ad first aired in Italy and France, and before it had aired, "Quick Fit wasn't even ranking in the top 400 Health & Fitness apps in Italy, let alone the top overall paid list. But that changed around the evening of June 20. We watched as Quick Fit climbed the top overall charts literally overnight".
How did we end up with an Apple ad to begin with? I think it's virtually impossible to plan for something like that. But I do think there were a few key factors that increased our chances of being selected.
One of the best decisions we made early on was to support multiple languages with Quick Fit and Wake Alarm. We focused on the key regions Apple recommends in its internationalization guidelines. Apps are a global phenomenon with millions of non-English-speaking users. We didn't want to limit our goal of helping people get fit to just English speakers, so we localized our app's interface, description, and even screenshots.
To read the article in full, hit up this link. Meanwhile, here's the Apple iPhone 5s ad 'Strength' featuring Quick Fit, which debuted last year (at the 30 second mark):
For developers out there, it's worth noting the advice provided by Jama, if you want to create an app that can gain popularity internationally.
Claimed iPad Pro Images Suggest Secondary Port [PIC]
Mon, March 30, 2015


text:
Network Rail awards £11.6 million Shotts contract
10 people found this useful
Network Rail has awarded an £11.6 million stations enhancements contract on the Shotts line between Holytown Junction and Midcalder Junction to Carillion Powerlines Ltd.
The work involves rebuilding Livingston South and Breich stations, and platform extensions at Carfin, Shotts and West Calder to enable the introduction of longer trains on the route.
Electrification of the line is expected to cost £160m and is due to be completed by March 2019.
Author: Andy Roden Andy Roden
Contributing Writer, RAIL
Andrew joined RAIL in 2000 as a news and features writer. He has written four books, covered the UK and international rail industries, and led 2005's successful campaign to save the 'Night Riviera' sleeper train. He is also a regular commentator on rail matters on television and radio for RAIL.
Carillion Powerlines Ltd
How Breich gets to be rebuilt is beyond me. 3 passengers a week albeit with a lousy service. If that was in England it would be closed no doubt because the money could be spent elsewhere delivering a genuine benefit to more passengers ensuring growth in rail services. Or some such governmental speak.
Once the electrification has been completed. Not only Class 380's will operate on the newly electrified Shotts line between Glasgow and Edinburgh. But also the Class 385's will also be operating on that line aswell the electrified Falkirk High line.
Once the electrification is finished in March next year and the Class 385's are in use. The Class 385's will be operated on the Shotts Line and on the Falkirk High Line between Glasgow Queen Street and Edinburgh Waverley.
Network Rail Chief Executive Andrew Haines is urging Government to be "realistic" about plans for up to £100 billion worth of infrastructure
Caledonian Sleeper Managing Director to step down
Caledonian Sleeper MD to leave post once replacement is appointed


text:
Who Let the Dog Out?
By: David Rosenfelt ISBN: 9781250055330
A lawyer by day-and then only when he's forced to take on new cases-Andy Carpenter's true passion is the Tara Foundation, the dog rescue organization he runs with his friend Willie Miller. So it's frightening when Willie calls him to say the alarm has gone off at the foundation building, and there's clearly been a break-in. It turns out that a recently rescued dog, nicknamed Cheyenne since her arrival at the foundation, has been stolen. Andy and Willie track the missing dog to a house in downtown Paterson, New Jersey and sure enough, they find the dog…standing right next to a dead body. The man had been gruesomely murdered mere minutes before Andy and Willie arrived. Could it be a coincidence? Or could the dog theft somehow be connected to the killing?
Andy takes Cheyenne safely back to the foundation building, and that should be the end of his involvement, but Andy's curiosity-and his desire to keep the dog from further harm-won't let him stop there. The cops have just arrested a man named Tommy Infante for the murder, but as Andy looks into the circumstances surrounding the break-in and the dog theft, he starts to wonder if Infante might actually be innocent. And when Andy takes Infante on as a client and starts searching in earnest for evidence that will exonerate him, what Andy starts to discover terrifies him. The murder might be just one small cog in a plot with far-reaching implications, and unless Andy can uncover the truth in time, thousands of lives could be in imminent danger.
Once again David Rosenfelt has written a fast-paced and clever mystery with his characteristic blend of humor, larger-than-life characters, and propulsive plotting.
I am a novelist with 27 dogs. I have gotten to this dubious position with absolutely no planning, and at no stage in my life could I have predicted it. But here I am.
My childhood was relentlessly normal. The middle of three brothers, loving parents, a middle-class home in Paterson, New Jersey. We played sports, studied sporadically. laughed around the dinner table, and generally had a good time. By comparison, "Ozzie and Harriet's" clan seemed bizarre.
I graduated NYU, then decided to go into the movie business. I was stunningly brilliant at a job interview with my uncle, who was President of United Artists, and was immediately hired. It set me off on a climb up the executive ladder, culminating in my becoming President of Marketing for Tri-Star Pictures. The movie landscape is filled with the movies I buried; for every "Rambo", "The Natural" and "Rocky", there are countless disasters. I did manage to find the time to marry and have two children, both of whom are doing very well, and fortunately neither have inherited my eccentricities.
A number of years ago, I left the movie marketing business, to the sustained applause of hundreds of disgruntled producers and directors. I decided to try my hand at writing. I wrote and sold a bunch of feature films, none of which ever came close to being actually filmed, and then a bunch of TV movies, some of which actually made it to the small screen. It's safe to say that their impact on the American cultural scene has been minimal.
About fourteen years ago, my wife and I started the Tara Foundation, named in honor of the greatest Golden Retriever the world has ever known. We rescued almost 4,000 dogs, many of them Goldens, and found them loving homes. Our own home quickly became a sanctuary for those dogs that we rescued that were too old or sickly to be wanted by others. They surround me as I write this. It's total lunacy, but it works, and they are a happy, safe group. Website
A special thank you to St. Martin's Press and NetGalley for an ARC in exchange for an honest review.
WHO LET THE DOG OUT by David Rosenfelt (Andy Carpenter #13), is a mix of legal thriller, murder mystery, a dog lovers world, humor, and baseball; for a fun-filled suspense engaging read. Attorney Andy Carpenter is an unabashed animal lover, and he has a reputation for saving both dogs and humans from Death Row. With the help of his beloved golden retriever Tara, Andy solves cases and wins courtroom battles in this acclaimed series of legal thrillers. The Tara Foundation, is a dog rescue organization, in New Jersey and attorney Andy Carpenter operates with his friend Willie (a former client). They are all about saving dogs, similar to Andy saving humans from death row in his legal practice. As the book opens a break-in occurs at the Tara Foundation. A recue dog, Cheyenne, a German shepherd mix has been stolen. The dog fortunately has a GPS chip, leading them to take off and investigate the dog whereabouts. What they find is shocking….the dog is standing to a dead man—brutally murdered. What gives? Andy, with his investigative attorney mind, seems to think there is more to the story, even though the cops arrested someone for the murder (Tommy Infante). However, have the cops arrested the correct man, or could he be innocent? Andy decides to take on Tommy as a client, and uncovers a bigger mystery which leads them to danger. While they are trying to track down Cheyenne's former owner—leading them to a fugitive suspected of murdering his business partner, an international diamond smuggling, and domestic terrorism, plus more. Who was the real owner of the dog and how is this connected to the murder? With an array of suspects, Andy is full of wit and humor with wise cracks, lovable dogs, and some good crime thrilling suspense mystery. With some personal fun with Andy --his wife Laurie, baseball, and their adopted eight-year old son, Ricky. This was my first book by Rosenfelt and was attracted to the series, as a lover of legal thrillers and golden retrievers(Wow, do I miss my special and unique golden –Golden Duke for fifteen wonderful years—great memories). This one is for you! Goldens are special dogs and lovers of Donna Ball's Raine Stockton Dog Mysteries (Golden-Cisco) will find the series intriguing. Rosenfelt's passion shines through each page. A strong delivery and some great legal and investigative work. Look forward to reading the next in the series, and catching up with the previous Andy Carpenter books. "BLACKOUT", coming 1/5/2016.
Review Links:
Tumblr JDC July Must Reads


Day 2: After breakfast Jaipur sightseeing. Overnight stay at hotel.
Day 3: After breakfast Proceed to Udaipur. Enroute visit Ajmer, Pushkar. Overnight stay at hotel.
Day 4: After breakfast Udaipur Sightseeing. Overnight stay at hotel.
Day 5: After breakfast Drive to mount Abu. Mount Abu sightseeing. Overnight stay at hotel.
Day 6 : Early morning after breakfast drive to Jodhpur. Jodhpur sightseeing. Overnight stay at hotel.
Day 7: Early morning after breakfast drive to Jaisalmer. Jaisalmer sightseeing. Overnight stay at hotel.
Day 8: After breakfast drive back to Jaipur and dropped at jaipur railways station.
If you have not decided yet or wants to customize tour itinerary or hotels listed above in "Beautiful Rajasthan Tour Package", then we can change the travel itinerary and make a personalized, tailor-made holiday package, especially for you. We can modify this travel package as per your itinerary, budget, duration and the tourist places you would like to visit, including transportation and airfare should be included or not. Please fill the form below to contact us.


text:
Vazodilatátor, tudi vazodilátor je snov ali učinkovina, ki širi žile oziroma povzroči relaksacijo gladkih mišičnih celic v steni žil, poveča pretok krvi skozi žile in zniža arterijski krvni tlak.

Endogeni vazodilatatorji
Pomembna endogena (telesu lastna) vazodilatatorja sta dušikov oksid (NO) in prostaciklin (PGI2), v zadnjem času pa vse večji pomen pripisujejo endotelijskemu hiperpolarizirajočemu dejavniku (EDHF), katerega kemijska zgradba in vloga pri človeku še nista pojasnjeni.

Učinkovine
Vazodilatorne učinke izražajo različne skupine učinkovin:
 organski nitrati (nitroglicerin, izosorbiddinitrat ...)
 zaviralci kalcijevih kanalčkov
 zaviralci renin-angiotenzin-aldosteronskega sistema (zaviralci angiotenzin pretvarjajočega encima, zaviralci angiotenzina II, zaviralci renina)
 hidralazin in dihidralazin
 analogi prostaciklina (iloprost) in prostaglandina E1 (alprostadil)
 zaviralci α1
 zaviralci endotelinskih receptorjev (npr. bosentan)
 zaviralci fosfodiesteraze tipa 5 (sildenafil, vardenafil, tadalafil)

Mehanizem delovanja
Vazodilatatorji povzročijo dilatacijo (širjenje) žil z različnimi mehanizmi. Določeni vazodilatatorji povzročijo dilatacijo zlasti venskega žilja (na primer nitrati), drugi učinkoviteje delujejo na arterije (na primer zaviralci kalcijevih kanalčkov, dihidralazin, zaviralci endotelinskih receptorjev), nekatere skupine vazodilatatorjev pa delujejo na obe skupini žilja (zaviralci angiotenzin pretvarjajočega encima, zaviralci angiotenzinskega receptorja II, zaviralci renina, zaviralci α1, natrijev nitroprusid). Z vensko vazodilatacijo se zmanjša pritok krvi v srce in s tem se zniža utripni volumen srca, z arterijsko vazodilatacijo pa se zmanjša upor v arterijskih žilah; oboje posledično vodi v padec krvnega tlaka.

Uporaba
Vazodilatatorji se uporabljajo pri različnih bolezenskih stanjih:
 povišan krvni tlak
 preeklampsija in eklampsija
 srčno popuščanje
 pljučna hipertenzija
 erektilna disfunkcija (zaviralci fosfodiesteraze tipa 5)

Sklici

Učinkovine
Vazodilatatorji

redpajama_set_name: RedPajamaWikipedia


text:
Q: JPA: createNativeQuery.getSingleResult() return an object, how I can get the value of one attribute inside that object I have a query like this
SET @rownum := 0;
SELECT rank, id, point FROM
      (
      SELECT @rownum := @rownum + 1 AS rank, id, point FROM user ORDER BY point DESC
      ) AS result
WHERE id = 0;

So I use EntityManager#createNativeQuery to execute this query.
Object temp = em.createNativeQuery(sql).getSingleResult(); //sql is the above SQL query

So now object temp hold information about rank, id, and point. Note that rank is not an attribute inside my Entity, rank is calculated when the query execute --> cant cast this object to my Entity.
So how can I get the value of rank?
EDIT
Here is the answer to what I am looking for. So instead of this
Object temp = em.createNativeQuery(sql).getSingleResult();

Do this
Object[] temp = (Object [])em.createNativeQuery(sql).getSingleResult();

Since I want to know the value of rank, then I would do this
Long rank = (Long) temp[0];

A: createNativeQuery method creates a Query instance. You have to invoke getResultList() or getSingleResult() on the Query object to actually execute the query.
http://download.oracle.com/javaee/5/api/javax/persistence/Query.html


text:
research.chalmers.se
Medieval Roof Structures in Sweden
Conference contribution, 2005
Churches in Sweden began to be built when Christianity was introduced at about the end of the first millennium. The churches gradually became important buildings generally located in the centre of a community. These early churches are now virtually the only buildings preserved in Sweden from medieval times. In the attics of the churches, a unique collection of timber roof trusses from the twelfth century and onward can be found. The church buildings usually have gabled roofs with gables of masonry. They can either have a nave, choir and apse, only a nave and choir, or be hall churches. The roof structures carry their load from wall to wall, crosswise to the longitudinal direction of the building, without use of a separate longitudinal bracing system. Longitudinal stability is achieved by the board covering and sometimes by diagonal beams between the rafters. The roof structure of the early Romanesque churches was clearly visible. Later, roof structures were concealed by ceilings. With the entry of Gothic architecture, many churches became vaulted. The structural load-carrying principles used evolved during medieval times. The early structures had tie beams connecting opposite sides of the roof at the base of them. When churches became vaulted, other approaches to supporting the horizontal thrust were developed.
Swedish churches
Structural behaviour
Roof truss
Medieval roof structures
Carl Thelin
Chalmers, Architecture
Other publications Research
Traditional & Innovative Materials & Techniques in the Conservation of Historic Structures
If you have questions, need help, find a bug or just want to give us feedback you may use this form, or contact us per e-mail research.lib@chalmers.se or by phone 46 (0)31-772 3744.
Your feedback has been sent! We will get back to you as soon as possible. Thank you.
Something went wrong! We're not sure why. This could be temporary. Please try again in a few minutes.
Research.chalmers.se contains research information from Chalmers University of Technology, Sweden. It includes information on projects, publications, research funders and collaborations.
More about coverage period and what is publicly available
Research projects at chalmers.se
SE-412 96 GOTHENBURG, SWEDEN
PHONE: +46 (0)31-772 10 00


One of the main features of Book Collector is that it automatically gives you full book details and cover images for the books in your collection.
And all those are provided by our own central online book database called: "Core for Books".
When you first try to add a book you will receive a warning that you are using the 'Example' database, it's up to you how you proceed: You can try adding books to the example collection to get a feel for how everything works, or you can get started immediately by creating your own database.
To get started with cataloging your Book Collection you'll need to create your own database.
Make sure you remember where you're saving your database.
*It's always a good idea to make a regular, external backup of your database. In the event of computer failure, or worse, you can always recover your collection. If you are creating lists for insurance purposes then an external backup is essential.
Adding books is done by searching that central online database, either by By ISBN or By Author/Title, then adding the results to your own local database.
Here you have the Add Books Automatically screen. This enables you to search our online book database and download detailed information to your own personal database.
by ISBN. The big advantage of searching by ISBN is that it will immediately give you the correct book and the correct Softcovers and Hardcovers edition. No need to wade through a long list of search results.
If you own a lot of Softcovers and/or Hardcovers, then consider getting our "CLZ Barry." ISBN scanner app (available for iOS and Android).
*Pro Tip: If your ISBN search does not deliver any results, don't give up! It does not mean our database does not have your book. We may still have full book details available, but just not "linked" to your ISBN. So just try again, this time searching by Title.
Book Collector will search our database for appropriate matches.
You can just select the correct book entry and click the Add button. This will give you full book details (author, title, cover images, publisher, subject, , etc…), plus a "generic" cover image, what we call the "default" book cover.
Alternatively, you can "expand" the book entry to make the program show all different Softcovers and Hardcovers editions we have listed for that particular book. This way you can select the specific edition that you own, with the specific Softcovers and Hardcovers cover that you own (if we indeed have your Softcovers and Hardcovers edition).
*TIP: If you can't find the book you were looking for, then check if you spelled the book title correctly. Also, it helps to enter the full title.
*Pro Tip: You can use the Queue Mode to add multiple books to the search queue. Click 'Show/Hide Queue' to enable/disable the Queue Mode. This is a Pro only feature.


Eating a peach is a summertime ritual. The health benefits of peaches range from vitamins that our bodies need each day to disease-fighting compounds. I originally wrote this story for Lifetime Daily.
It's summertime and festivals around the world are celebrating this fuzzy fruit. No more so than in China — the world's largest producer of peaches — where the fruit is a symbol of longevity and immortality. A relative of the rose and almond, the peach is revered for its luscious flavour but the peach is also worth celebrating for its many health benefits, especially for older adults.
1. Peaches may prevent cancer.
A study of peaches and plums found that the stone fruits' high levels of phenolic compounds killed estrogen-dependent breast cancer cells. Even the most aggressive breast cancer cells couldn't stand up to the peach's antioxidant properties. Meanwhile, normal cells stayed intact.
2. Peaches keep cholesterol in check.
Peaches contain very little fat, but that's not the only reason they're good for cholesterol levels. Research shows that antioxidants in the skin and flesh of clingstone peaches prevents the oxidation of LDL cholesterol (the bad one), helping to maintain heart and cardiovascular health.
3. Peaches may fend off obesity-related illness.
The bioactive compounds in stone fruits, including peaches and nectarines, can potentially fight diabetes and cardiovascular disease connected to obesity and inflammation, or metabolic syndrome.
4. Peaches keep you looking young.
Peaches are high in vitamin C, with a medium peach containing about 17% of our daily needs. They're also low in carbohydrates. Upping vitamin C intake while lowering carbs can keep wrinkles at bay, prevent dryness and keep skin looking and feeling its best.
5. Peaches are good for our eyes.
A medium peach contains about 10% of our vitamin A daily requirement. Vitamin A has been connected to brain, organ and eye health. Even low levels of beta carotene, which is the form vitamin A takes in plants, have been linked to reduced risk of age-related macular degeneration and other chronic vision diseases.
Peaches are a low- to no-fuss fruit — simply wash and eat them out of hand. Don't be shy, there are only about 50 to 68 calories in a peach.
Opinions differ on how to ripen peaches. Some insist leaving them on the counter or layering between breathable fabric, like cotton. Others store them in a paper bag.
Try adding chopped peaches to yogurt, or toss into a smoothie or shake. Fresh clingstone or freestone peaches make for a perfect pie, melba or cobbler, while surprising combinations come in the form of savory treats: grilled peach halves topped with tuna salad; chopped peaches with basil for a bruschetta topping; or peach slices with prosciutto on pizza.
Freezing peaches is easy, so you can enjoy them throughout the year. Score a small X on the bottom of the fruit, put in boiling water for 30 seconds and then immerse in cold water. This will loosen the skin for easy peeling before slicing or dicing peaches to freeze. They're more time-consuming but canned peaches also make for wonderful winter provisions.


text:
/////////////////////////////////////////////////////////////////////////////
// GridCtrl.h : header file
//
// MFC Grid Control - main header
//
// Written by Chris Maunder <chris@codeproject.com>
// Copyright (c) 1998-2005. All Rights Reserved.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name and all copyright
// notices remains intact.
//
// An email letting me know how you are using it would be nice as well.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability for any damage/loss of business that
// this product may cause.
//
// For use with CGridCtrl v2.20+
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GRIDCTRL_H__519FA702_722C_11D1_ABBA_00A0243D1382__INCLUDED_)
#define AFX_GRIDCTRL_H__519FA702_722C_11D1_ABBA_00A0243D1382__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "CellRange.h"
#include "GridCell.h"
#include <afxtempl.h>
#include <vector>

///////////////////////////////////////////////////////////////////////////////////
// Defines - these determine the features (and the final size) of the final code
///////////////////////////////////////////////////////////////////////////////////

//#define GRIDCONTROL_NO_TITLETIPS   // Do not use titletips for cells with large data
//#define GRIDCONTROL_NO_DRAGDROP    // Do not use OLE drag and drop
//#define GRIDCONTROL_NO_CLIPBOARD   // Do not use clipboard routines

#ifdef _WIN32_WCE
#   define GRIDCONTROL_NO_TITLETIPS   // Do not use titletips for cells with large data
#   define GRIDCONTROL_NO_DRAGDROP    // Do not use OLE drag and drop
#   define GRIDCONTROL_NO_CLIPBOARD   // Do not use clipboard routines
#   define GRIDCONTROL_NO_PRINTING    // Do not use printing routines
#   ifdef WCE_NO_PRINTING			  // Older versions of CE had different #def's
#       define _WIN32_WCE_NO_PRINTING
#   endif
#   ifdef WCE_NO_CURSOR
#       define _WIN32_WCE_NO_CURSOR
#   endif
#endif  // _WIN32_WCE

// Use this as the classname when inserting this control as a custom control
// in the MSVC++ dialog editor
#define GRIDCTRL_CLASSNAME    _T("MFCGridCtrl")  // Window class name
#define IDC_INPLACE_CONTROL   8                  // ID of inplace edit controls

///////////////////////////////////////////////////////////////////////////////////
// Conditional includes
///////////////////////////////////////////////////////////////////////////////////

#ifndef GRIDCONTROL_NO_TITLETIPS
#   include "TitleTip.h"
#endif

#ifndef GRIDCONTROL_NO_DRAGDROP
#   include "GridDropTarget.h"
#   undef GRIDCONTROL_NO_CLIPBOARD     // Force clipboard functions on
#endif

#ifndef GRIDCONTROL_NO_CLIPBOARD
#   include <afxole.h>
#endif

///////////////////////////////////////////////////////////////////////////////////
// Helper functions
///////////////////////////////////////////////////////////////////////////////////

// Handy functions
#define IsSHIFTpressed() ( (GetKeyState(VK_SHIFT) & (1 << (sizeof(SHORT)*8-1))) != 0   )
#define IsCTRLpressed()  ( (GetKeyState(VK_CONTROL) & (1 << (sizeof(SHORT)*8-1))) != 0 )

// Backwards compatibility for pre 2.20 grid versions
#define DDX_GridControl(pDX, nIDC, rControl)  DDX_Control(pDX, nIDC, rControl)

///////////////////////////////////////////////////////////////////////////////////
// Structures
///////////////////////////////////////////////////////////////////////////////////

// This structure sent to Grid's parent in a WM_NOTIFY message
typedef struct tagNM_GRIDVIEW {
    NMHDR hdr;
    int   iRow;
    int   iColumn;
} NM_GRIDVIEW;

// This is sent to the Grid from child in-place edit controls
typedef struct tagGV_DISPINFO {
    NMHDR   hdr;
    GV_ITEM item;
} GV_DISPINFO;

// This is sent to the Grid from child in-place edit controls
typedef struct tagGV_CACHEHINT {
    NMHDR      hdr;
    CCellRange range;
} GV_CACHEHINT;

// storage typedef for each row in the grid
typedef CTypedPtrArray<CObArray, CGridCellBase*> GRID_ROW;

// For virtual mode callback
typedef BOOL (CALLBACK* GRIDCALLBACK)(GV_DISPINFO *, LPARAM);

///////////////////////////////////////////////////////////////////////////////////
// Defines
///////////////////////////////////////////////////////////////////////////////////

// Grid line/scrollbar selection
#define GVL_NONE                0L      // Neither
#define GVL_HORZ                1L      // Horizontal line or scrollbar
#define GVL_VERT                2L      // Vertical line or scrollbar
#define GVL_BOTH                3L      // Both

// Autosizing option
#define GVS_DEFAULT             0
#define GVS_HEADER              1       // Size using column fixed cells data only
#define GVS_DATA                2       // Size using column non-fixed cells data only
#define GVS_BOTH                3       // Size using column fixed and non-fixed

// Cell Searching options
#define GVNI_FOCUSED            0x0001
#define GVNI_SELECTED           0x0002
#define GVNI_DROPHILITED        0x0004
#define GVNI_READONLY           0x0008
#define GVNI_FIXED              0x0010
#define GVNI_MODIFIED           0x0020

#define GVNI_ABOVE              LVNI_ABOVE
#define GVNI_BELOW              LVNI_BELOW
#define GVNI_TOLEFT             LVNI_TOLEFT
#define GVNI_TORIGHT            LVNI_TORIGHT
#define GVNI_ALL                (LVNI_BELOW|LVNI_TORIGHT|LVNI_TOLEFT)
#define GVNI_AREA               (LVNI_BELOW|LVNI_TORIGHT)

// Hit test values (not yet implemented)
#define GVHT_DATA               0x0000
#define GVHT_TOPLEFT            0x0001
#define GVHT_COLHDR             0x0002
#define GVHT_ROWHDR             0x0004
#define GVHT_COLSIZER           0x0008
#define GVHT_ROWSIZER           0x0010
#define GVHT_LEFT               0x0020
#define GVHT_RIGHT              0x0040
#define GVHT_ABOVE              0x0080
#define GVHT_BELOW              0x0100

// Messages sent to the grid's parent (More will be added in future)
#define GVN_BEGINDRAG           LVN_BEGINDRAG        // LVN_FIRST-9
#define GVN_BEGINLABELEDIT      LVN_BEGINLABELEDIT   // LVN_FIRST-5
#define GVN_BEGINRDRAG          LVN_BEGINRDRAG
#define GVN_COLUMNCLICK         LVN_COLUMNCLICK
#define GVN_DELETEITEM          LVN_DELETEITEM
#define GVN_ENDLABELEDIT        LVN_ENDLABELEDIT     // LVN_FIRST-6
#define GVN_SELCHANGING         LVN_ITEMCHANGING
#define GVN_SELCHANGED          LVN_ITEMCHANGED
#define GVN_GETDISPINFO         LVN_GETDISPINFO
#define GVN_ODCACHEHINT         LVN_ODCACHEHINT

class CGridCtrl;

/////////////////////////////////////////////////////////////////////////////
// CGridCtrl window

typedef bool (*PVIRTUALCOMPARE)(int, int);

class CGridCtrl : public CWnd
{
    DECLARE_DYNCREATE(CGridCtrl)
    friend class CGridCell;
    friend class CGridCellBase;

// Construction
public:
    CGridCtrl(int nRows = 0, int nCols = 0, int nFixedRows = 0, int nFixedCols = 0);

    BOOL Create(const RECT& rect, CWnd* parent, UINT nID,
                DWORD dwStyle = WS_CHILD | WS_BORDER | WS_TABSTOP | WS_VISIBLE);

///////////////////////////////////////////////////////////////////////////////////
// Attributes
///////////////////////////////////////////////////////////////////////////////////
public:
    int  GetRowCount() const                    { return m_nRows; }
    int  GetColumnCount() const                 { return m_nCols; }
    int  GetFixedRowCount() const               { return m_nFixedRows; }
    int  GetFixedColumnCount() const            { return m_nFixedCols; }
    BOOL SetRowCount(int nRows = 10);
    BOOL SetColumnCount(int nCols = 10);
    BOOL SetFixedRowCount(int nFixedRows = 1);
    BOOL SetFixedColumnCount(int nFixedCols = 1);

    int  GetRowHeight(int nRow) const;
    BOOL SetRowHeight(int row, int height);
    int  GetColumnWidth(int nCol) const;
    BOOL SetColumnWidth(int col, int width);

    BOOL GetCellOrigin(int nRow, int nCol, LPPOINT p);
    BOOL GetCellOrigin(const CCellID& cell, LPPOINT p);
    BOOL GetCellRect(int nRow, int nCol, LPRECT pRect);
    BOOL GetCellRect(const CCellID& cell, LPRECT pRect);

    BOOL GetTextRect(const CCellID& cell, LPRECT pRect);
    BOOL GetTextRect(int nRow, int nCol, LPRECT pRect);

    CCellID GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck = TRUE);

    int  GetFixedRowHeight() const;
    int  GetFixedColumnWidth() const;
    long GetVirtualWidth() const;
    long GetVirtualHeight() const;

    CSize GetTextExtent(int nRow, int nCol, LPCTSTR str);
    // EFW - Get extent of current text in cell
    inline CSize GetCellTextExtent(int nRow, int nCol)  { return GetTextExtent(nRow, nCol, GetItemText(nRow,nCol)); }

    void     SetGridBkColor(COLORREF clr)         { m_crGridBkColour = clr;           }
    COLORREF GetGridBkColor() const               { return m_crGridBkColour;          }
    void     SetGridLineColor(COLORREF clr)       { m_crGridLineColour = clr;         }
    COLORREF GetGridLineColor() const             { return m_crGridLineColour;        }

	void	 SetTitleTipBackClr(COLORREF clr = CLR_DEFAULT) { m_crTTipBackClr = clr;  }
	COLORREF GetTitleTipBackClr()				            { return m_crTTipBackClr; }
	void	 SetTitleTipTextClr(COLORREF clr = CLR_DEFAULT) { m_crTTipTextClr = clr;  }
	COLORREF GetTitleTipTextClr()				            { return m_crTTipTextClr; }

    // ***************************************************************************** //
    // These have been deprecated. Use GetDefaultCell and then set the colors
    void     SetTextColor(COLORREF clr)      { m_cellDefault.SetTextClr(clr);        }
    COLORREF GetTextColor()                  { return m_cellDefault.GetTextClr();    }
    void     SetTextBkColor(COLORREF clr)    { m_cellDefault.SetBackClr(clr);        }
    COLORREF GetTextBkColor()                { return m_cellDefault.GetBackClr();    }
    void     SetFixedTextColor(COLORREF clr) { m_cellFixedRowDef.SetTextClr(clr);
                                               m_cellFixedColDef.SetTextClr(clr);
                                               m_cellFixedRowColDef.SetTextClr(clr); }
    COLORREF GetFixedTextColor() const       { return m_cellFixedRowDef.GetTextClr(); }
    void     SetFixedBkColor(COLORREF clr)   { m_cellFixedRowDef.SetBackClr(clr);
                                               m_cellFixedColDef.SetBackClr(clr);
                                               m_cellFixedRowColDef.SetBackClr(clr); }
    COLORREF GetFixedBkColor() const         { return m_cellFixedRowDef.GetBackClr(); }
    void     SetGridColor(COLORREF clr)      { SetGridLineColor(clr);                }
    COLORREF GetGridColor()                  { return GetGridLineColor();            }
    void     SetBkColor(COLORREF clr)        { SetGridBkColor(clr);                  }
    COLORREF GetBkColor()                    { return GetGridBkColor();              }

    void     SetDefCellMargin( int nMargin)  { m_cellDefault.SetMargin(nMargin);
                                               m_cellFixedRowDef.SetMargin(nMargin);
                                               m_cellFixedColDef.SetMargin(nMargin);
                                               m_cellFixedRowColDef.SetMargin(nMargin); }
    int      GetDefCellMargin() const        { return m_cellDefault.GetMargin();     }

    int      GetDefCellHeight() const        { return m_cellDefault.GetHeight();     }
    void     SetDefCellHeight(int nHeight)   { m_cellDefault.SetHeight(nHeight);
                                               m_cellFixedRowDef.SetHeight(nHeight);
                                               m_cellFixedColDef.SetHeight(nHeight);
                                               m_cellFixedRowColDef.SetHeight(nHeight); }
    int      GetDefCellWidth() const         { return m_cellDefault.GetWidth();     }
    void     SetDefCellWidth(int nWidth)     { m_cellDefault.SetWidth(nWidth);
                                               m_cellFixedRowDef.SetWidth(nWidth);
                                               m_cellFixedColDef.SetWidth(nWidth);
                                               m_cellFixedRowColDef.SetWidth(nWidth); }

    // ***************************************************************************** //

    int GetSelectedCount() const                  { return (int)m_SelectedCellMap.GetCount(); }

    CCellID SetFocusCell(CCellID cell);
    CCellID SetFocusCell(int nRow, int nCol);
    CCellID GetFocusCell() const                  { return m_idCurrentCell;           }

    void SetVirtualMode(BOOL bVirtual);
    BOOL GetVirtualMode() const                   { return m_bVirtualMode;            }
    void SetCallbackFunc(GRIDCALLBACK pCallback,
                         LPARAM lParam)           { m_pfnCallback = pCallback; m_lParam = lParam; }
    GRIDCALLBACK GetCallbackFunc()                { return m_pfnCallback;             }

    void SetImageList(CImageList* pList)          { m_pImageList = pList;             }
    CImageList* GetImageList() const              { return m_pImageList;              }

    void SetGridLines(int nWhichLines = GVL_BOTH);
    int  GetGridLines() const                     { return m_nGridLines;              }
    void SetEditable(BOOL bEditable = TRUE)       { m_bEditable = bEditable;          }
    BOOL IsEditable() const                       { return m_bEditable;               }
    void SetListMode(BOOL bEnableListMode = TRUE);
    BOOL GetListMode() const                      { return m_bListMode;               }
    void SetSingleRowSelection(BOOL bSing = TRUE) { m_bSingleRowSelection = bSing;    }
    BOOL GetSingleRowSelection()                  { return m_bSingleRowSelection & m_bListMode; }
    void SetSingleColSelection(BOOL bSing = TRUE) { m_bSingleColSelection = bSing;    }
    BOOL GetSingleColSelection()                  { return m_bSingleColSelection;     }
    void EnableSelection(BOOL bEnable = TRUE)     { ResetSelectedRange(); m_bEnableSelection = bEnable; ResetSelectedRange(); }
    BOOL IsSelectable() const                     { return m_bEnableSelection;        }
    void SetFixedColumnSelection(BOOL bSelect)    { m_bFixedColumnSelection = bSelect;}
    BOOL GetFixedColumnSelection()                { return m_bFixedColumnSelection;   }
    void SetFixedRowSelection(BOOL bSelect)       { m_bFixedRowSelection = bSelect;   }
    BOOL GetFixedRowSelection()                   { return m_bFixedRowSelection;      }
    void EnableDragAndDrop(BOOL bAllow = TRUE)    { m_bAllowDragAndDrop = bAllow;     }
    BOOL GetDragAndDrop() const                   { return m_bAllowDragAndDrop;       }
    void SetRowResize(BOOL bResize = TRUE)        { m_bAllowRowResize = bResize;      }
    BOOL GetRowResize() const                     { return m_bAllowRowResize;         }
    void SetColumnResize(BOOL bResize = TRUE)     { m_bAllowColumnResize = bResize;   }
    BOOL GetColumnResize() const                  { return m_bAllowColumnResize;      }
    void SetHeaderSort(BOOL bSortOnClick = TRUE)  { m_bSortOnClick = bSortOnClick;    }
    BOOL GetHeaderSort() const                    { return m_bSortOnClick;            }
    void SetHandleTabKey(BOOL bHandleTab = TRUE)  { m_bHandleTabKey = bHandleTab;     }
    BOOL GetHandleTabKey() const                  { return m_bHandleTabKey;           }
    void SetDoubleBuffering(BOOL bBuffer = TRUE)  { m_bDoubleBuffer = bBuffer;        }
    BOOL GetDoubleBuffering() const               { return m_bDoubleBuffer;           }
    void EnableTitleTips(BOOL bEnable = TRUE)     { m_bTitleTips = bEnable;           }
    BOOL GetTitleTips()                           { return m_bTitleTips;              }
    void SetSortColumn(int nCol);
    int  GetSortColumn() const                    { return m_nSortColumn;             }
    void SetSortAscending(BOOL bAscending)        { m_bAscending = bAscending;        }
    BOOL GetSortAscending() const                 { return m_bAscending;              }
    void SetTrackFocusCell(BOOL bTrack)           { m_bTrackFocusCell = bTrack;       }
    BOOL GetTrackFocusCell()                      { return m_bTrackFocusCell;         }
    void SetFrameFocusCell(BOOL bFrame)           { m_bFrameFocus = bFrame;           }
    BOOL GetFrameFocusCell()                      { return m_bFrameFocus;             }
    void SetAutoSizeStyle(int nStyle = GVS_BOTH)  { m_nAutoSizeColumnStyle = nStyle;  }
    int  GetAutoSizeStyle()                       { return m_nAutoSizeColumnStyle; }

    void EnableHiddenColUnhide(BOOL bEnable = TRUE){ m_bHiddenColUnhide = bEnable;    }
    BOOL GetHiddenColUnhide()                     { return m_bHiddenColUnhide;        }
    void EnableHiddenRowUnhide(BOOL bEnable = TRUE){ m_bHiddenRowUnhide = bEnable;    }
    BOOL GetHiddenRowUnhide()                     { return m_bHiddenRowUnhide;        }

    void EnableColumnHide(BOOL bEnable = TRUE)    { m_bAllowColHide = bEnable;        }
    BOOL GetColumnHide()                          { return m_bAllowColHide;           }
    void EnableRowHide(BOOL bEnable = TRUE)       { m_bAllowRowHide = bEnable;        }
    BOOL GetRowHide()                             { return m_bAllowRowHide;           }

///////////////////////////////////////////////////////////////////////////////////
// default Grid cells. Use these for setting default values such as colors and fonts
///////////////////////////////////////////////////////////////////////////////////
public:
    CGridCellBase* GetDefaultCell(BOOL bFixedRow, BOOL bFixedCol) const;

///////////////////////////////////////////////////////////////////////////////////
// Grid cell Attributes
///////////////////////////////////////////////////////////////////////////////////
public:
    CGridCellBase* GetCell(int nRow, int nCol) const;   // Get the actual cell!

    void SetModified(BOOL bModified = TRUE, int nRow = -1, int nCol = -1);
    BOOL GetModified(int nRow = -1, int nCol = -1);
    BOOL IsCellFixed(int nRow, int nCol);

    BOOL   SetItem(const GV_ITEM* pItem);
    BOOL   GetItem(GV_ITEM* pItem);
    BOOL   SetItemText(int nRow, int nCol, LPCTSTR str);
    // The following was virtual. If you want to override, use
    //  CGridCellBase-derived class's GetText() to accomplish same thing
    CString GetItemText(int nRow, int nCol) const;

    // EFW - 06/13/99 - Added to support printf-style formatting codes.
    // Also supports use with a string resource ID
#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 210)
    BOOL   SetItemTextFmt(int nRow, int nCol, LPCTSTR szFmt, ...);
    BOOL   SetItemTextFmtID(int nRow, int nCol, UINT nID, ...);
#endif

    BOOL   SetItemData(int nRow, int nCol, LPARAM lParam);
    LPARAM GetItemData(int nRow, int nCol) const;
    BOOL   SetItemImage(int nRow, int nCol, int iImage);
    int    GetItemImage(int nRow, int nCol) const;
    BOOL   SetItemState(int nRow, int nCol, UINT state);
    UINT   GetItemState(int nRow, int nCol) const;
    BOOL   SetItemFormat(int nRow, int nCol, UINT nFormat);
    UINT   GetItemFormat(int nRow, int nCol) const;
    BOOL   SetItemBkColour(int nRow, int nCol, COLORREF cr = CLR_DEFAULT);
    COLORREF GetItemBkColour(int nRow, int nCol) const;
    BOOL   SetItemFgColour(int nRow, int nCol, COLORREF cr = CLR_DEFAULT);
    COLORREF GetItemFgColour(int nRow, int nCol) const;
    BOOL SetItemFont(int nRow, int nCol, const LOGFONT* lf);
    const LOGFONT* GetItemFont(int nRow, int nCol);

    BOOL IsItemEditing(int nRow, int nCol);

    BOOL SetCellType(int nRow, int nCol, CRuntimeClass* pRuntimeClass);
    BOOL SetDefaultCellType( CRuntimeClass* pRuntimeClass);

///////////////////////////////////////////////////////////////////////////////////
// Operations
///////////////////////////////////////////////////////////////////////////////////
public:
    int  InsertColumn(LPCTSTR strHeading, UINT nFormat = DT_CENTER|DT_VCENTER|DT_SINGLELINE,
                      int nColumn = -1);
    int  InsertRow(LPCTSTR strHeading, int nRow = -1);
    BOOL DeleteColumn(int nColumn);
    BOOL DeleteRow(int nRow);
    BOOL DeleteNonFixedRows();
    BOOL DeleteAllItems();

	void ClearCells(CCellRange Selection);

    BOOL AutoSizeRow(int nRow, BOOL bResetScroll = TRUE);
    BOOL AutoSizeColumn(int nCol, UINT nAutoSizeStyle = GVS_DEFAULT, BOOL bResetScroll = TRUE);
    void AutoSizeRows();
    void AutoSizeColumns(UINT nAutoSizeStyle = GVS_DEFAULT);
    void AutoSize(UINT nAutoSizeStyle = GVS_DEFAULT);
    void ExpandColumnsToFit(BOOL bExpandFixed = TRUE);
    void ExpandLastColumn();
    void ExpandRowsToFit(BOOL bExpandFixed = TRUE);
    void ExpandToFit(BOOL bExpandFixed = TRUE);

    void Refresh();
    void AutoFill();   // Fill grid with blank cells

    void EnsureVisible(CCellID &cell)       { EnsureVisible(cell.row, cell.col); }
    void EnsureVisible(int nRow, int nCol);
    BOOL IsCellVisible(int nRow, int nCol);
    BOOL IsCellVisible(CCellID cell);
    BOOL IsCellEditable(int nRow, int nCol) const;
    BOOL IsCellEditable(CCellID &cell) const;
    BOOL IsCellSelected(int nRow, int nCol) const;
    BOOL IsCellSelected(CCellID &cell) const;

    // SetRedraw stops/starts redraws on things like changing the # rows/columns
    // and autosizing, but not for user-intervention such as resizes
    void SetRedraw(BOOL bAllowDraw, BOOL bResetScrollBars = FALSE);
    BOOL RedrawCell(int nRow, int nCol, CDC* pDC = NULL);
    BOOL RedrawCell(const CCellID& cell, CDC* pDC = NULL);
    BOOL RedrawRow(int row);
    BOOL RedrawColumn(int col);

#ifndef _WIN32_WCE
    BOOL Save(LPCTSTR filename, TCHAR chSeparator = _T(','));
    BOOL Load(LPCTSTR filename, TCHAR chSeparator = _T(','));
#endif

///////////////////////////////////////////////////////////////////////////////////
// Cell Ranges
///////////////////////////////////////////////////////////////////////////////////
 public:
    CCellRange GetCellRange() const;
    CCellRange GetSelectedCellRange() const;
    void SetSelectedRange(const CCellRange& Range, BOOL bForceRepaint = FALSE, BOOL bSelectCells = TRUE);
    void SetSelectedRange(int nMinRow, int nMinCol, int nMaxRow, int nMaxCol,
                          BOOL bForceRepaint = FALSE, BOOL bSelectCells = TRUE);
    BOOL IsValid(int nRow, int nCol) const;
    BOOL IsValid(const CCellID& cell) const;
    BOOL IsValid(const CCellRange& range) const;

///////////////////////////////////////////////////////////////////////////////////
// Clipboard, drag and drop, and cut n' paste operations
///////////////////////////////////////////////////////////////////////////////////
#ifndef GRIDCONTROL_NO_CLIPBOARD
    virtual void CutSelectedText();
    virtual COleDataSource* CopyTextFromGrid();
    virtual BOOL PasteTextToGrid(CCellID cell, COleDataObject* pDataObject, BOOL bSelectPastedCells=TRUE);
#endif

#ifndef GRIDCONTROL_NO_DRAGDROP
 public:
    virtual void OnBeginDrag();
    virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
    virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
    virtual void OnDragLeave();
    virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
#endif

#ifndef GRIDCONTROL_NO_CLIPBOARD
    virtual void OnEditCut();
    virtual void OnEditCopy();
    virtual void OnEditPaste();
#endif
    virtual void OnEditSelectAll();

///////////////////////////////////////////////////////////////////////////////////
// Misc.
///////////////////////////////////////////////////////////////////////////////////
public:
    CCellID GetNextItem(CCellID& cell, int nFlags) const;

	BOOL SortItems(int nCol, BOOL bAscending, LPARAM data = 0);
    BOOL SortTextItems(int nCol, BOOL bAscending, LPARAM data = 0);
    BOOL SortItems(PFNLVCOMPARE pfnCompare, int nCol, BOOL bAscending, LPARAM data = 0);

	void SetCompareFunction(PFNLVCOMPARE pfnCompare);

	// in-built sort functions
	static int CALLBACK pfnCellTextCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK pfnCellNumericCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

///////////////////////////////////////////////////////////////////////////////////
// Printing
///////////////////////////////////////////////////////////////////////////////////
#if !defined(_WIN32_WCE_NO_PRINTING) && !defined(GRIDCONTROL_NO_PRINTING)
public:
    void Print(CPrintDialog* pPrntDialog = NULL);

    // EFW - New printing support functions
    void EnableWysiwygPrinting(BOOL bEnable = TRUE) { m_bWysiwygPrinting = bEnable;     }
    BOOL GetWysiwygPrinting()                       { return m_bWysiwygPrinting;        }

    void SetShadedPrintOut(BOOL bEnable = TRUE)     {   m_bShadedPrintOut = bEnable;    }
    BOOL GetShadedPrintOut(void)                    {   return m_bShadedPrintOut;       }

    // Use -1 to have it keep the existing value
    void SetPrintMarginInfo(int nHeaderHeight, int nFooterHeight,
        int nLeftMargin, int nRightMargin, int nTopMargin,
        int nBottomMargin, int nGap);

    void GetPrintMarginInfo(int &nHeaderHeight, int &nFooterHeight,
        int &nLeftMargin, int &nRightMargin, int &nTopMargin,
        int &nBottomMargin, int &nGap);

///////////////////////////////////////////////////////////////////////////////////
// Printing overrides for derived classes
///////////////////////////////////////////////////////////////////////////////////
public:
    virtual void OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo);
    virtual void OnPrint(CDC *pDC, CPrintInfo *pInfo);
    virtual void OnEndPrinting(CDC *pDC, CPrintInfo *pInfo);

#endif // #if !defined(_WIN32_WCE_NO_PRINTING) && !defined(GRIDCONTROL_NO_PRINTING)

// Implementation
public:
    virtual ~CGridCtrl();

protected:
    BOOL RegisterWindowClass();
    BOOL Initialise();
    void SetupDefaultCells();

    LRESULT SendMessageToParent(int nRow, int nCol, int nMessage) const;
    LRESULT SendDisplayRequestToParent(GV_DISPINFO* pDisplayInfo) const;
    LRESULT SendCacheHintToParent(const CCellRange& range) const;

    BOOL InvalidateCellRect(const int row, const int col);
    BOOL InvalidateCellRect(const CCellID& cell);
    BOOL InvalidateCellRect(const CCellRange& cellRange);
    void EraseBkgnd(CDC* pDC);

    BOOL GetCellRangeRect(const CCellRange& cellRange, LPRECT lpRect);

    BOOL SetCell(int nRow, int nCol, CGridCellBase* pCell);

    int  SetMouseMode(int nMode) { int nOldMode = m_MouseMode; m_MouseMode = nMode; return nOldMode; }
    int  GetMouseMode() const    { return m_MouseMode; }

    BOOL MouseOverRowResizeArea(CPoint& point);
    BOOL MouseOverColumnResizeArea(CPoint& point);

    CCellID GetTopleftNonFixedCell(BOOL bForceRecalculation = FALSE);
    CCellRange GetUnobstructedNonFixedCellRange(BOOL bForceRecalculation = FALSE);
    CCellRange GetVisibleNonFixedCellRange(LPRECT pRect = NULL, BOOL bForceRecalculation = FALSE);
    CCellRange GetVisibleFixedCellRange(LPRECT pRect = NULL, BOOL bForceRecalculation = FALSE);

    BOOL IsVisibleVScroll() { return ( (m_nBarState & GVL_VERT) > 0); }
    BOOL IsVisibleHScroll() { return ( (m_nBarState & GVL_HORZ) > 0); }
    void ResetSelectedRange();
    void ResetScrollBars();
    void EnableScrollBars(int nBar, BOOL bEnable = TRUE);
    int  GetScrollPos32(int nBar, BOOL bGetTrackPos = FALSE);
    BOOL SetScrollPos32(int nBar, int nPos, BOOL bRedraw = TRUE);

    BOOL SortTextItems(int nCol, BOOL bAscending, int low, int high);
    BOOL SortItems(PFNLVCOMPARE pfnCompare, int nCol, BOOL bAscending, LPARAM data,
                   int low, int high);

    CPoint GetPointClicked(int nRow, int nCol, const CPoint& point);

	void ValidateAndModifyCellContents(int nRow, int nCol, LPCTSTR strText);

// Overrrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CGridCtrl)
    protected:
    virtual void PreSubclassWindow();
    //}}AFX_VIRTUAL

protected:
#if !defined(_WIN32_WCE_NO_PRINTING) && !defined(GRIDCONTROL_NO_PRINTING)
    // Printing
	virtual void PrintFixedRowCells(int nStartColumn, int nStopColumn, int& row, CRect& rect,
                                    CDC *pDC, BOOL& bFirst);
    virtual void PrintColumnHeadings(CDC *pDC, CPrintInfo *pInfo);
    virtual void PrintHeader(CDC *pDC, CPrintInfo *pInfo);
    virtual void PrintFooter(CDC *pDC, CPrintInfo *pInfo);
    virtual void PrintRowButtons(CDC *pDC, CPrintInfo* /*pInfo*/);
#endif

#ifndef GRIDCONTROL_NO_DRAGDROP
    // Drag n' drop
    virtual CImageList* CreateDragImage(CPoint *pHotSpot);    // no longer necessary
#endif

    // Mouse Clicks
    virtual void  OnFixedColumnClick(CCellID& cell);
    virtual void  OnFixedRowClick(CCellID& cell);

    // Editing
    virtual void  OnEditCell(int nRow, int nCol, CPoint point, UINT nChar);
    virtual void  OnEndEditCell(int nRow, int nCol, CString str);
	virtual BOOL  ValidateEdit(int nRow, int nCol, LPCTSTR str);
    virtual void  EndEditing();

    // Drawing
    virtual void  OnDraw(CDC* pDC);

    // CGridCellBase Creation and Cleanup
    virtual CGridCellBase* CreateCell(int nRow, int nCol);
    virtual void DestroyCell(int nRow, int nCol);

// Attributes
protected:
    // General attributes
    COLORREF    m_crFixedTextColour, m_crFixedBkColour;
    COLORREF    m_crGridBkColour, m_crGridLineColour;
    COLORREF    m_crWindowText, m_crWindowColour, m_cr3DFace,     // System colours
                m_crShadow;
    COLORREF    m_crTTipBackClr, m_crTTipTextClr;                 // Titletip colours - FNA

    BOOL        m_bVirtualMode;
    LPARAM      m_lParam;                                           // lParam for callback
    GRIDCALLBACK m_pfnCallback;                                     // The callback function

    int         m_nGridLines;
    BOOL        m_bEditable;
    BOOL        m_bModified;
    BOOL        m_bAllowDragAndDrop;
    BOOL        m_bListMode;
    BOOL        m_bSingleRowSelection;
    BOOL        m_bSingleColSelection;
    BOOL        m_bAllowDraw;
    BOOL        m_bEnableSelection;
    BOOL        m_bFixedRowSelection, m_bFixedColumnSelection;
    BOOL        m_bSortOnClick;
    BOOL        m_bHandleTabKey;
    BOOL        m_bDoubleBuffer;
    BOOL        m_bTitleTips;
    int         m_nBarState;
    BOOL        m_bWysiwygPrinting;
    BOOL        m_bHiddenColUnhide, m_bHiddenRowUnhide;
    BOOL        m_bAllowColHide, m_bAllowRowHide;
    BOOL        m_bAutoSizeSkipColHdr;
    BOOL        m_bTrackFocusCell;
    BOOL        m_bFrameFocus;
    UINT        m_nAutoSizeColumnStyle;

    // Cell size details
    int         m_nRows, m_nFixedRows, m_nCols, m_nFixedCols;
    CUIntArray  m_arRowHeights, m_arColWidths;
    int         m_nVScrollMax, m_nHScrollMax;

    // Fonts and images
    CRuntimeClass*   m_pRtcDefault; // determines kind of Grid Cell created by default
    CGridDefaultCell m_cellDefault;  // "default" cell. Contains default colours, font etc.
    CGridDefaultCell m_cellFixedColDef, m_cellFixedRowDef, m_cellFixedRowColDef;
    CFont       m_PrinterFont;  // for the printer
    CImageList* m_pImageList;

    // Cell data
    CTypedPtrArray<CObArray, GRID_ROW*> m_RowData;

    // Mouse operations such as cell selection
    int         m_MouseMode;
    BOOL        m_bLMouseButtonDown, m_bRMouseButtonDown;
    CPoint      m_LeftClickDownPoint, m_LastMousePoint;
    CCellID     m_LeftClickDownCell, m_SelectionStartCell;
    CCellID     m_idCurrentCell, m_idTopLeftCell;
    INT_PTR     m_nTimerID;
    int         m_nTimerInterval;
    int         m_nResizeCaptureRange;
    BOOL        m_bAllowRowResize, m_bAllowColumnResize;
    int         m_nRowsPerWheelNotch;
    CMap<DWORD,DWORD, CCellID, CCellID&> m_SelectedCellMap, m_PrevSelectedCellMap;

#ifndef GRIDCONTROL_NO_TITLETIPS
    CTitleTip   m_TitleTip;             // Title tips for cells
#endif

    // Drag and drop
    CCellID     m_LastDragOverCell;
#ifndef GRIDCONTROL_NO_DRAGDROP
    CGridDropTarget m_DropTarget;       // OLE Drop target for the grid
#endif

    // Printing information
    CSize       m_CharSize;
    int         m_nPageHeight;
    CSize       m_LogicalPageSize,      // Page size in gridctrl units.
                m_PaperSize;            // Page size in device units.
    // additional properties to support Wysiwyg printing
    int         m_nPageWidth;
    int         m_nPrintColumn;
    int         m_nCurrPrintRow;
    int         m_nNumPages;
    int         m_nPageMultiplier;

    // sorting
    int          m_bAscending;
    int          m_nSortColumn;
	PFNLVCOMPARE m_pfnCompare;

    // EFW - Added to support shaded/unshaded printout.  If true, colored
    // cells will print as-is.  If false, all text prints as black on white.
    BOOL        m_bShadedPrintOut;

    // EFW - Added support for user-definable margins.  Top and bottom are in
    // lines.  Left, right, and gap are in characters (avg width is used).
    int         m_nHeaderHeight, m_nFooterHeight, m_nLeftMargin,
                m_nRightMargin, m_nTopMargin, m_nBottomMargin, m_nGap;

protected:
    void SelectAllCells();
    void SelectColumns(CCellID currentCell, BOOL bForceRedraw=FALSE, BOOL bSelectCells=TRUE);
    void SelectRows(CCellID currentCell, BOOL bForceRedraw=FALSE, BOOL bSelectCells=TRUE);
    void SelectCells(CCellID currentCell, BOOL bForceRedraw=FALSE, BOOL bSelectCells=TRUE);
    void OnSelecting(const CCellID& currentCell);

    // Generated message map functions
    //{{AFX_MSG(CGridCtrl)
    afx_msg void OnPaint();
    afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnTimer(UINT nIDEvent);
    afx_msg UINT OnGetDlgCode();
    afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
    //}}AFX_MSG
#ifndef _WIN32_WCE_NO_CURSOR
    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
#endif
#ifndef _WIN32_WCE
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnRButtonUp(UINT nFlags, CPoint point);    // EFW - Added
    afx_msg void OnSysColorChange();
#endif
#ifndef _WIN32_WCE_NO_CURSOR
    afx_msg void OnCaptureChanged(CWnd *pWnd);
#endif
#ifndef GRIDCONTROL_NO_CLIPBOARD
    afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
    afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
    afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
#endif
#if (_MFC_VER >= 0x0421) || (_WIN32_WCE >= 210)
    afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
#endif
#if !defined(_WIN32_WCE) && (_MFC_VER >= 0x0421)
    afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
#endif
    afx_msg LRESULT OnSetFont(WPARAM hFont, LPARAM lParam);
    afx_msg LRESULT OnGetFont(WPARAM hFont, LPARAM lParam);
    afx_msg LRESULT OnImeChar(WPARAM wCharCode, LPARAM lParam);
    afx_msg void OnEndInPlaceEdit(NMHDR* pNMHDR, LRESULT* pResult);
    DECLARE_MESSAGE_MAP()

    enum eMouseModes { MOUSE_NOTHING, MOUSE_SELECT_ALL, MOUSE_SELECT_COL, MOUSE_SELECT_ROW,
                       MOUSE_SELECT_CELLS, MOUSE_SCROLLING_CELLS,
                       MOUSE_OVER_ROW_DIVIDE, MOUSE_SIZING_ROW,
                       MOUSE_OVER_COL_DIVIDE, MOUSE_SIZING_COL,
                       MOUSE_PREPARE_EDIT,
#ifndef GRIDCONTROL_NO_DRAGDROP
                       MOUSE_PREPARE_DRAG, MOUSE_DRAGGING
#endif
    };
//      for sort in virtual mode, and column order, save and load layer
public:
	typedef std::vector<int> intlist;
	void Reorder(int From, int To);
	void SetVirtualCompare(PVIRTUALCOMPARE VirtualCompare) { m_pfnVirtualCompare = VirtualCompare;}
	int m_CurCol;
	void AllowReorderColumn(bool b=true) { m_AllowReorderColumn = b;}
	void EnableDragRowMode(bool b=true) { m_bDragRowMode = b; if(b) EnableDragAndDrop(); } // to change row order
	int GetLayer(int** pLayer); //  gives back the number of ints of the area (do not forget to delete *pLayer)
	void SetLayer(int* pLayer); // coming from a previous GetLayer (ignored if not same number of column, or the same revision number)
	void ForceQuitFocusOnTab(bool b=true) { m_QuitFocusOnTab = b;} // use only if GetParent() is a CDialog
	void AllowSelectRowInFixedCol(bool b=true) { m_AllowSelectRowInFixedCol = b;} //
//    allow acces?
	intlist m_arRowOrder, m_arColOrder;
	static CGridCtrl* m_This;
protected:
	virtual void AddSubVirtualRow(int Num, int Nb);
	bool m_bDragRowMode;
	int m_CurRow;
private:
	void ResetVirtualOrder();
	PVIRTUALCOMPARE m_pfnVirtualCompare;
	static bool NotVirtualCompare(int c1, int c2);
	bool m_InDestructor;
	bool m_AllowReorderColumn;
	bool m_QuitFocusOnTab;
	bool m_AllowSelectRowInFixedCol;

};

// Returns the default cell implementation for the given grid region
inline CGridCellBase* CGridCtrl::GetDefaultCell(BOOL bFixedRow, BOOL bFixedCol) const
{
    if (bFixedRow && bFixedCol) return (CGridCellBase*) &m_cellFixedRowColDef;
    if (bFixedRow)              return (CGridCellBase*) &m_cellFixedRowDef;
    if (bFixedCol)              return (CGridCellBase*) &m_cellFixedColDef;
    return (CGridCellBase*) &m_cellDefault;
}

inline CGridCellBase* CGridCtrl::GetCell(int nRow, int nCol) const
{
    if (nRow < 0 || nRow >= m_nRows || nCol < 0 || nCol >= m_nCols)
        return NULL;

    if (GetVirtualMode())
    {
        CGridCellBase* pCell = GetDefaultCell(nRow < m_nFixedRows, nCol < m_nFixedCols);
        static GV_DISPINFO gvdi;
        gvdi.item.row     = nRow;
        gvdi.item.col     = nCol;
        gvdi.item.mask    = 0xFFFFFFFF;
        gvdi.item.nState  = 0;
        gvdi.item.nFormat = pCell->GetFormat();
        gvdi.item.iImage  = pCell->GetImage();
        gvdi.item.crBkClr = pCell->GetBackClr();
        gvdi.item.crFgClr = pCell->GetTextClr();
        gvdi.item.lParam  = pCell->GetData();
        memcpy(&gvdi.item.lfFont, pCell->GetFont(), sizeof(LOGFONT));
        gvdi.item.nMargin = pCell->GetMargin();
        gvdi.item.strText.Empty();

        // Fix the state bits
        if (IsCellSelected(nRow, nCol))   gvdi.item.nState |= GVIS_SELECTED;
        if (nRow < GetFixedRowCount())    gvdi.item.nState |= (GVIS_FIXED | GVIS_FIXEDROW);
        if (nCol < GetFixedColumnCount()) gvdi.item.nState |= (GVIS_FIXED | GVIS_FIXEDCOL);
        if (GetFocusCell() == CCellID(nRow, nCol)) gvdi.item.nState |= GVIS_FOCUSED;
		if(!m_InDestructor)
		{
			gvdi.item.row = m_arRowOrder[nRow];
			gvdi.item.col = m_arColOrder[nCol];

			if (m_pfnCallback)
				m_pfnCallback(&gvdi, m_lParam);
			else
				SendDisplayRequestToParent(&gvdi);
			gvdi.item.row = nRow;
			gvdi.item.col = nCol;
		}
        static CGridCell cell;
        cell.SetState(gvdi.item.nState);
        cell.SetFormat(gvdi.item.nFormat);
        cell.SetImage(gvdi.item.iImage);
        cell.SetBackClr(gvdi.item.crBkClr);
        cell.SetTextClr(gvdi.item.crFgClr);
        cell.SetData(gvdi.item.lParam);
        cell.SetFont(&(gvdi.item.lfFont));
        cell.SetMargin(gvdi.item.nMargin);
        cell.SetText(gvdi.item.strText);
        cell.SetGrid((CGridCtrl*)this);

        return (CGridCellBase*) &cell;
    }

    GRID_ROW* pRow = m_RowData[nRow];
    if (!pRow) return NULL;
    return pRow->GetAt(m_arColOrder[nCol]);
}

inline BOOL CGridCtrl::SetCell(int nRow, int nCol, CGridCellBase* pCell)
{
    if (GetVirtualMode())
        return FALSE;

    if (nRow < 0 || nRow >= m_nRows || nCol < 0 || nCol >= m_nCols)
        return FALSE;

    GRID_ROW* pRow = m_RowData[nRow];
    if (!pRow) return FALSE;

    pCell->SetCoords( nRow, nCol);
    pRow->SetAt(nCol, pCell);

    return TRUE;
}

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GRIDCTRL_H__519FA702_722C_11D1_ABBA_00A0243D1382__INCLUDED_)

redpajama_set_name: RedPajamaGithub