c++builder

struct tm tm_isdst disagrees with BST

时光毁灭记忆、已成空白 提交于 2020-07-22 06:11:46
问题 I'm in the UK. I'm using C++ builder 10.2 with the clang compiler. The following code #include <stdio.h> #include <conio.h> #include <time.h> #ifdef _WIN32 #include <tchar.h> #else typedef char _TCHAR; #define _tmain main #endif int _tmain() { printf("TZ set = %s\r\n",putenv("TZ=Europe/London")==0 ? "true" : "false"); printf("TZ=%s\r\n",getenv("TZ")); for (int dst = 0, year = 2017; year <= 2023; year++) for (int mon = 1; mon <= 12; mon++) for (int mday = 1; mday <= 31; mday++) { struct tm st

How to ignore accelerator chars in TWebBrowser (design mode)

痴心易碎 提交于 2020-07-22 05:59:05
问题 I have essentially the same problem like the one described in this question: How to make TWebBrowser ignore accelerator chars of others controls? So the TWebBrowser is in design mode and accelerator keys from TAction are executing associated action. The solution was: type TWebBrowser = class(SHDocVw.TWebBrowser) procedure CNChar(var Message: TWMChar); message CN_CHAR; end; ... procedure TWebBrowser.CNChar(var Message: TWMChar); begin Message.Result := 0; end; I'd like to try the solution

Delphi - form within form

℡╲_俬逩灬. 提交于 2020-07-17 07:49:05
问题 For aesthetic reasons, I want to show a form on top of another form, just as if it were a component, say like a TPanel. It should resize with the parent, move around as the parent is dragged by its title bar, etc. ----------------------------- | main form component 1 | ----------------------------- | main | the 'embedded' | | form | form goes here | |comp 2| | ----------------------------- can I do that? If so how? I am now leaning towards MDI... 回答1: Put a panel where you want your embedded

Wrong color when using CopyRect to copy from large image to smaller canvas

余生长醉 提交于 2020-06-28 05:23:55
问题 I was writing a function to shrink a source image (JPG file) according to a 170 x 200px picture. The source JPG image was loaded into a TImage (Image1, fixed size of 400 x 400px, stretched to fit with aspect ration maintained), then the user will make a selection rectangle to set the area to copy, and then the image will be copied using CopyRect() onto the destination TImage (Image2). void __fastcall TSizePhotoForm::Button3Click(TObject *Sender) { float scale, base = 400.0f; TRect crect; //

Convert the Sender parameter of an event handler in order to read the control's Name?

徘徊边缘 提交于 2020-05-14 14:15:22
问题 I am writing a Form application using Borland C++Builder 6.0. I have put 2 TImage controls and I have generated the OnClick event handler as shown below: void __fastcall TForm1::Image1Click(TObject *Sender) { AnsiString imageName; TImage *image; // How can I get the image name via the *Sender ? // How can I convert *Sender into TImage image = (TComponent)*Sender; imageName = image->Name; } I have assigned the same OnClick event on both of my TImage controls. What I want to achieve is to have

How to fix “abnormal program termination” when using TREST components in C++ Builder? [duplicate]

一曲冷凌霜 提交于 2020-04-18 05:56:50
问题 This question already has an answer here : Abnormal program termination on shutdown with TRESTClient (1 answer) Closed 22 days ago . I get "abnormal program termination" error when i close my application. When i use TREST components, i get the error above with a raised exception First chance exception at $741FAA12. Exception class EBindingScopeFactoryError with message 'Scope class TBindSourceAdapterCustomScope not registered'. on this specific line on Data.Bind.ObjectScope unit, i tried to

How to fix “abnormal program termination” when using TREST components in C++ Builder? [duplicate]

邮差的信 提交于 2020-04-18 05:56:17
问题 This question already has an answer here : Abnormal program termination on shutdown with TRESTClient (1 answer) Closed 22 days ago . I get "abnormal program termination" error when i close my application. When i use TREST components, i get the error above with a raised exception First chance exception at $741FAA12. Exception class EBindingScopeFactoryError with message 'Scope class TBindSourceAdapterCustomScope not registered'. on this specific line on Data.Bind.ObjectScope unit, i tried to

Load a bmp file into a TSpeedButton

允我心安 提交于 2020-04-18 05:45:29
问题 Using Embarcadero C++Builder, does anyone know how to manually load a .bmp file into a TSpeedButton using the Glyph property, setting a path to the image, not with the Object Inspector? 回答1: The Glyph property is a TBitmap, so you can use the TBitmap::LoadFromFile() method to load a new glyph from a file: speedbutton->Glyph->LoadFromFile("filename.bmp"); Note: " Glyph can provide up to four images within a single bitmap. All images must be the same size and next to each other in a horizontal

Load a bmp file into a TSpeedButton

↘锁芯ラ 提交于 2020-04-18 05:45:21
问题 Using Embarcadero C++Builder, does anyone know how to manually load a .bmp file into a TSpeedButton using the Glyph property, setting a path to the image, not with the Object Inspector? 回答1: The Glyph property is a TBitmap, so you can use the TBitmap::LoadFromFile() method to load a new glyph from a file: speedbutton->Glyph->LoadFromFile("filename.bmp"); Note: " Glyph can provide up to four images within a single bitmap. All images must be the same size and next to each other in a horizontal

Image not showing in TSpeedButton

此生再无相见时 提交于 2020-03-04 15:57:21
问题 I'm working with Embarcadero C++Builder. I'm using the TSpeedButton component with a .bmp image. No matter what format I try, everything looks great in the IDE, but when I compile and generate the .exe file and then start the application, there are no images. There is the text with a small white square on the TSpeedButton . I have tried the .png , .jpg , .bmp , .ico formats. Is there any solution to my issue?. 回答1: TSpeedButton has property NumGlyphs which indicates how many images Glyph