ChrisChuah
Members-
Content Count
111 -
Joined
-
Last visited
Everything posted by ChrisChuah
-
hi here is the getItInstall.log. From GitHub, it states that SynEdit supports up to Delphi 10.4 Could this error due to not able to support 11.1? regards chris ====== Start ====== [2022-08-29 09:28:55] [DEBUG] GetIt: Loading EULAS... [2022-08-29 09:29:02] [DEBUG] GetIt: Installing Library "SynEdit for VCL"... [2022-08-29 09:29:03] [DEBUG] GetIt: Downloading Library "SynEdit for VCL"... [2022-08-29 09:29:07] [DEBUG] GetIt: Extracting Library "SynEdit for VCL" to "C:\Users\chuahyen\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\". This could take a while... [2022-08-29 09:29:08] [DEBUG] GetIt: Compiling project "SynEditDR.dproj"... [2022-08-29 09:29:13] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Release" configuration. [2022-08-29 09:29:15] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Debug" configuration. [2022-08-29 09:29:17] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Release" configuration. [2022-08-29 09:29:18] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Debug" configuration. [2022-08-29 09:29:19] [DEBUG] GetIt: Error when executing an action of "SynEdit for VCL" catalog. The action is "CompileProject" (ID 6). [2022-08-29 09:29:19] [DEBUG] GetIt: A problem occurred during the process. [2022-08-29 09:29:26] [DEBUG] GetIt: Cancelling process... [2022-08-29 09:29:39] [DEBUG] GetIt: Loading EULAS... [2022-08-29 09:29:41] [DEBUG] GetIt: Installing Library "SynEdit for VCL"... [2022-08-29 09:29:41] [DEBUG] GetIt: Downloading Library "SynEdit for VCL"... [2022-08-29 09:29:42] [DEBUG] GetIt: Extracting Library "SynEdit for VCL" to "C:\Users\chuahyen\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\". This could take a while... [2022-08-29 09:29:42] [DEBUG] GetIt: Compiling project "SynEditDR.dproj"... [2022-08-29 09:29:45] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Release" configuration. [2022-08-29 09:29:47] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Debug" configuration. [2022-08-29 09:29:48] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Release" configuration. [2022-08-29 09:29:50] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Debug" configuration. [2022-08-29 09:29:50] [DEBUG] GetIt: Error when executing an action of "SynEdit for VCL" catalog. The action is "CompileProject" (ID 6). [2022-08-29 09:29:50] [DEBUG] GetIt: A problem occurred during the process. [2022-08-29 09:32:26] [DEBUG] GetIt: Cancelling process... ===== End =======
-
tried to install the SynEdit via PackageManager and it could not be installed on Delphi 11.1 Anyone encountered this problem? regards chris
-
ShowModal does not show window after a few tries (It does not pop up)
ChrisChuah posted a topic in VCL
HI I am having this funny problem in Delphi 11.1 using VCL. ==== FDetailForm := TfrmAircraftTypesNew.Create(self); try (FDetailForm as TfrmAircraftTypesNew).setData(UpdateRow, l_rec); FDetailForm.Visible := false; FDetailForm.ShowModal; finally l_rec.Free; end; FDetailForm := nil; ======= When i open and close the FDetailForm a few times, the detail form would not show and the main window will hang. See this video to see what i mean. In the Form Close of the TfrmAircraftTypesNew, i will have Action := caFree; Screen Recording 2022-08-22 at 20.55.21.mp4 Can help why the form is not able to show on top. I have already tried to put the PopupMode to Explicit. Another Finding: when i remove or commented the style from the startup, i did not have this problem of not able to showModal Application.Initialize; // TStyleManager.TrySetStyle('Iceberg Classico'); <== Remove/commented this line Application.CreateForm(TDataModule1, DataModule1); Application.CreateForm(TfrmMain, frmMain); Application.Run; Not sure why this style is giving problem.... Please advise regards chris -
ShowModal does not show window after a few tries (It does not pop up)
ChrisChuah replied to ChrisChuah's topic in VCL
Ok. I will try to write a small part of the code to see if i can reproduce the same error or not thanks chris -
ShowModal does not show window after a few tries (It does not pop up)
ChrisChuah replied to ChrisChuah's topic in VCL
We are just learning. I am still learning too I tried not to create the form but to call showmodal each time user click on the update button But i will get a problem is that cannot Showmodal when the form is visible. In the FormClose of aircrafttype form, i set it to caHide instead of caFree and i have that error. I feel that even though i have use delphi since Delphi 1, i am still learning how to use this language. Delphi 6 was the most stable version that i used and I am still using that now to do minor changes to those application written in 2007. -
ShowModal does not show window after a few tries (It does not pop up)
ChrisChuah replied to ChrisChuah's topic in VCL
The DetailForm close event will have Action := caFree I tried this way ===== Ghosting Windows procedure DisableProcessWindowsGhosting; var DisableProcessWindowsGhostingProc: procedure; begin DisableProcessWindowsGhostingProc := GetProcAddress( GetModuleHandle('user32.dll'), 'DisableProcessWindowsGhosting'); if Assigned(DisableProcessWindowsGhostingProc) then DisableProcessWindowsGhostingProc; end; begin Application.Initialize; DisableProcessWindowsGhosting; TStyleManager.TrySetStyle('Iceberg Classico'); Application.CreateForm(TDataModule1, DataModule1); Application.CreateForm(TfrmMain, frmMain); Application.Run; end. ======================= But will also have the same effect that open and close the form too many times will result in hanging of the application or the form will not show. Only when i removed the Style Manager, then i will not have this problem. The Grid is also having its own DrawColumnCell Event ===================== procedure TfrmMain.dbgACTDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var l_bitmap : TBitmap; l_rect : TRect; l_bmpWidth, l_width : integer; l_str : string; begin with dbgACT do begin if (gdSelected in State) then begin Canvas.Font.Color := clBlack; Canvas.Brush.Color := clLime; end else begin if ( (DataSource.Dataset).RecNo mod 2 = 0) then begin if Canvas.Brush.Color = Color then begin Canvas.Brush.Color := clSkyBlue; end; end; end; end; l_rect := Rect; l_str := Column.Field.DisplayText; l_width := dbgACT.Canvas.TextExtent(l_str).cx + 5; if Column.FieldName = 'ROW_ID' then begin l_bitmap := TBitmap.create; try ImageList2.GetBitmap(tsACT.ImageIndex, l_bitmap); l_bmpWidth := (Rect.bottom - Rect.Top); l_rect.Right := Rect.Left + l_bmpWidth; dbgACT.Canvas.StretchDraw(l_rect, l_bitmap); finally l_bitmap.Free; end; // cc : reset the output rectangle l_rect := Rect; l_rect.Left := l_rect.Left + l_bmpWidth; l_width := 5 + dbgACT.Canvas.TextExtent(l_str).cx; end; if (l_width > Column.Width) then Column.Width := l_width; dbgACT.DefaultDrawColumnCell(l_rect, DataCol, (Column as TColumn), State); end; ==================== But not sure if this affected the style manager or not regards chris -
Hi When the database table is updated and i use dbgrid.datasource.dataset.refresh, the dbgrid is refreshed back to the first row. Is it possible to refresh the grid without going back to the first row? This is because if there is frequent update to the database and this Refresh notification is sent to my app each time another app updates the table, the dbgrid will always move back to the first row when it is refreshed. Any advise regards chris
-
DBGrid repaint or refresh when dataset is refreshed
ChrisChuah replied to ChrisChuah's topic in Databases
Thanks. need to use locate with disable/enable controls so that the table will not have moving effect. However, for my dataset, it has 50 columns but the dbgrid can only show first 10 columns on the screen. If need to show next 10 columns, i will need to scroll to the next 10 columns. So, when i am looking at the next 10 columns and the table refreshed, can the refresh go to the next 10 columns rather than always go back to the 1st 10 columns? regards cris -
DBGrid repaint or refresh when dataset is refreshed
ChrisChuah replied to ChrisChuah's topic in Databases
hi i have tried using gotobookmark on TQuery with TClientDataset and it could not work. Will try to use the locate function. thanks -
DBGrid repaint or refresh when dataset is refreshed
ChrisChuah replied to ChrisChuah's topic in Databases
hi ok i will try it with the locate function for the disablecontrols and enablecontrols thanks chris -
DBGrid repaint or refresh when dataset is refreshed
ChrisChuah replied to ChrisChuah's topic in Databases
If there is frequent update to the table, then the user will see the table moving up and down (always locating the record) isnt it? will this (record pointer moving up and down on the grid) happen? -
Hi Is there a way to auto detect when there is no mouse activity and the VCL application will log out for users? thanks chris
-
Hi I managed to implement it in windows using this event TfrmMain : TForm Gauge1 : TGauge; tmrInactivity: TTimer; procedure FormCreate(Sender: TObject); procedure tmrInactivityTimer(Sender: TObject); private FInactivityTimeout : cardinal; FInactivityCounter : cardinal; // cc : application event to handle key down and left mouse click // cc : for activity timeout procedure ApplicationEventMsg(var Msg: tagMSG; var Handled: Boolean); public end; procedure TfrmMain.FormCreate(Sender: TObject); var l_ini : TIniFile; begin // this event msg is to capture keyboard and mouse event Application.OnMessage := ApplicationEventMsg; // cc : get the amount of seconds allowed before timeout l_ini := TIniFile.create(ChangeFileExt(Application.ExeName, '.ini')); FInactivityTimeout := l_ini.ReadInteger('Main', 'Inactivity Timeout', 60); Gauge1.MaxValue := FInactivityTimeout; Gauge1.MinValue := 0; FInactivityCounter := 0; l_ini.Free; end; procedure TfrmMain.tmrInactivityTimer(Sender: TObject); begin // Inactivity timeout will disconnect every connection tmrInactivity.Enabled := false; if (not DataModule1.getLoginSuccess) then begin FInactivityCounter := 0; Gauge1.Progress := 0; tmrInactivity.Enabled := true; exit; end; if (FInactivityCounter > FInactivityTimeout) then begin DataModule1.closeAll; end; FInactivityCounter := 0; Gauge1.Progress := 0; end else begin FInactivityCounter := FInActivityCounter +1; Gauge1.Progress := FInactivityCounter; end; tmrInactivity.Enabled := true; end;
-
Hi I am using TSQLQuery, TClientDataSet and TDataSetProvider with DBGrid If i want to sort the DBGrid based on title column click, i can use the event OnTitleClick on DBGrid ClientDataSet.IndexFieldsName := Column.FieldName However, this will sort the Field in ascending order. How can i sort it in descending order? please advise regards chris
-
Hi I have another question. After i use the AddIndex and set the IndexName to the index field created, how can i get back the information of what index field is used and what is the sorting order (asc or desc) e.g. l_indexName := 'ABN_REM' + '_INDEX'; l_indexes := TStringList.create; (TntDBGrid1.DataSource.DataSet as TClientDataSet).GetIndexNames(l_indexes); if l_indexes.IndexOf(l_indexName) > -1 then (TntDBGrid1.DataSource.DataSet as TClientDataset).DeleteIndex(l_indexName); l_indexes.Free; (TntDBGrid1.DataSource.DataSet as TClientDataset).AddIndex(l_indexName, 'FREE_REM', [ixDescending],'','',0 ); (TntDBGrid1.DataSource.DataSet as TClientDataset).IndexName := l_indexName; In the above code, i have set the IndexName to 'ABN_REM_INDEX' with field 'FREE_REM' used and sort in descending order. So, how can i get back this information that the field name 'FREE_REM' is used and the sorting is in descending order? regards chris
-
hi Thanks. I will use the AddIndex function to do the sorting. regards chris
-
DBGrid selected row does not highlight the selected row when ClientDataSet is Closed and Open again
ChrisChuah posted a topic in Databases
Hi I am using TSQLQuery, TClientDataSet and TDataSetProvider with DBGrid I will click on the record row in the middle of the grid and the grid shows that it is highlighted HOwever, when i close and open the ClientDataSet to refresh the data, i would use the bookmark to go back to the last bookmark before the Client dataset is Close l_bookmark := TntDBGrid1.Datasource.DataSet.GetBookmark; TntDBGrid1.DataSource.DataSet.Close; TntDBGrid1.DataSource.Dataset.Open; TntDBGrid1.DataSource.DataSet.GotoBookmark(l_bookmark); TntDBGrid1.DataSource.Dataset.FreeBookmark(l_bookmark); After open, the indicator is shown correctly on the dbgrid but the highlighted row is on the first row. see pic please advise regards chris -
DBGrid selected row does not highlight the selected row when ClientDataSet is Closed and Open again
ChrisChuah replied to ChrisChuah's topic in Databases
Hi I am not sure if this function affected the drawing procedure TForm1.ClientDataSet1AfterOpen(DataSet: TDataSet); var l_index : integer; l_fieldName : string; begin for l_index := 0 to ClientDataSet1.FieldCount - 1 do begin l_fieldName := ClientDataSet1.Fields[l_index].FieldName; ClientDataSet1.Fields[l_index].DisplayWidth :=10; if (l_fieldName = 'SDT') or (l_fieldName = 'EST_D') or (l_fieldName = 'LAST_D') or (l_fieldName = 'ACT_D') or (l_fieldName = 'CREATED_AT') or (l_fieldName = 'UPDATED_AT') then ClientDataSet1.Fields[l_index].OnGetText := getDateTimeStr else if (l_fieldName = 'STIME') then ClientDataSet1.Fields[l_index].OnGetText := getTimeStr else if (l_fieldName = 'SDATE') then ClientDataSet1.Fields[l_index].OnGetText := getDateStr else if (l_fieldName = 'ORDEST_N_C') or (l_fieldName = 'FREE_REM') then ClientDataSet1.Fields[l_index].OnGetText := getForeignStr; end; Dataset.Last; end; procedure TForm1.TntDBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var l_bitmap : TBitmap; l_rect : TRect; l_bmpWidth, l_width : integer; l_str : string; begin if (ClientDataSet1.RecNo mod 2 = 0) then begin if TntDBGrid1.Canvas.Brush.Color = TntDBGrid1.Color then begin TntDBGrid1.Canvas.Brush.Color := clSkyBlue; end; end; l_rect := Rect; l_str := Column.Field.DisplayText; if Column.FieldName = 'ROW_ID' then begin l_bitmap := TBitmap.create; try ImageList3.GetBitmap(1, l_bitmap); l_bmpWidth := (Rect.bottom - Rect.Top); l_rect.Right := Rect.Left + l_bmpWidth; TntDBGrid1.Canvas.StretchDraw(l_rect, l_bitmap); finally l_bitmap.Free; end; // cc : reset the output rectangle l_rect := Rect; l_rect.Left := l_rect.Left + l_bmpWidth; l_width := 5 + TntDBGrid1.Canvas.TextExtent(l_str).cx; <== if (l_width > Column.Width) then <== Column.Width := l_width; <== end; TntDBGrid1.DefaultDrawColumnCell(l_rect, DataCol, (Column as TTntColumn), State); end; As i store all the dates as Unix Epoch format. hence i need to translate all the values to date time format when drawn on the grid. However, is there a way to know when the drawing on the grid is completed? Or is there a better way to make the grid draw out faster? Seems like if i dont make it auto size for every column, the drawing is faster. The longest column is the Foreign Characters and the resizing took quite long there Is there a way to auto size and auto fit the column which is not done during the drawing part? please advise regards chris -
DBGrid selected row does not highlight the selected row when ClientDataSet is Closed and Open again
ChrisChuah replied to ChrisChuah's topic in Databases
I just found out that i can use the dataset to refresh rather than Open and close. The dbgrid will refresh with updated content. Now i have another problem is when i open the dataset, the dbgrid is filled to the bottom and it will somehow stop there.. i need to scroll down to request it to draw again. anyone have this problem? is there a way to scroll all the way down the grid automatically once the drawing is completed? please see this video on the problem.. anyone can advise? source procedure TfrmMain.dbgABNDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var l_bitmap : TBitmap; l_rect : TRect; l_bmpWidth, l_width : integer; l_str : string; begin if ( (dbgABN.DataSource.Dataset as TClientDataset).RecNo mod 2 = 0) then begin if dbgABN.Canvas.Brush.Color = dbgABN.Color then begin dbgABN.Canvas.Brush.Color := clSkyBlue; end; end; l_rect := Rect; l_str := Column.Field.DisplayText; if Column.FieldName = 'ROW_ID' then begin l_bitmap := TBitmap.create; try ImageList2.GetBitmap(0, l_bitmap); l_bmpWidth := (Rect.bottom - Rect.Top); l_rect.Right := Rect.Left + l_bmpWidth; dbgABN.Canvas.StretchDraw(l_rect, l_bitmap); finally l_bitmap.Free; end; // cc : reset the output rectangle l_rect := Rect; l_rect.Left := l_rect.Left + l_bmpWidth; end; l_width := 5 + dbgABN.Canvas.TextExtent(l_str).cx; if (l_width > Column.Width) then Column.Width := l_width; dbgABN.DefaultDrawColumnCell(l_rect, DataCol, (Column as TTntColumn), State); end; Screen_Recording_2022-06-30_at_9_50.33_AM.mp4 -
DBGrid selected row does not highlight the selected row when ClientDataSet is Closed and Open again
ChrisChuah replied to ChrisChuah's topic in Databases
Thank you. Seems like i did not see that bookmarks are invalidated when dataset is closed and opened again. Then how can i refresh the dataset if i do not close and open it? -
Thank you for your help
-
Hi Is there a link to download Indy as well as installation manual for Lazarus running on Ubuntu X86_64? please advise regards chris
-
Indy download and installation on Lazarus running on Ubuntu
ChrisChuah replied to ChrisChuah's topic in Indy
thank you justin Will try it out on lazarus -
Hi For the TLabel, i can align the text vertically centre using the Layout properties. However, for TEdit, there isnt any option for this. Please help on how i can have the TEdit text aligned vertically centered. regards chris
-
thanks remy Its working now. not sure why i could not connect to that link when i was in office thanks chris