PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: docroger on July 30, 2025, 06:11:07 AM

Title: Tab control with DDT ?
Post by: docroger on July 30, 2025, 06:11:07 AM
Hello José,

Is it possible to have tab control, like in Powerbasic ?

I find control add tab, but next ?
Like Tab insert page ?

An example ?

If you have time...
Thanx.
Title: Re: Tab control with DDT ?
Post by: José Roca on July 30, 2025, 01:13:06 PM
I plan to implement it for CWindow. With DDT everything becomes complicated because of the limitations of the dialog engine. It does not like to have controls that are children of other controls.
Title: Re: Tab control with DDT ?
Post by: José Roca on July 30, 2025, 10:21:22 PM
Tab control with CWindow.

https://github.com/JoseRoca/AfxNova/blob/main/SDK%20Templates/CW_TabCtrl_01.bas

I wil try to get to work with DDT, but I have not much hope.

Attached a compiled example.
Title: Re: Tab control with DDT ?
Post by: docroger on July 31, 2025, 05:27:55 AM
Thanx José.
I switch to cwindow...
Thanx for your effort.
Title: Re: Tab control with DDT ?
Post by: José Roca on August 05, 2025, 03:43:12 AM
I have got it working with DDT.
See: https://github.com/JoseRoca/AfxNova/blob/main/DDT%20Templates/EX_DDT_TabCtrl_01.bas

It seems that I have found the solution to the repaintig problems with dialogs, While with CWindow is not needed to process WM_PAINT when resizing, with dialogs I have to do:

CASE WM_PAINT
   DIM hTab AS HWND = ControlHandle(hDlg, IDC_TAB)
   SetWindowPos hTab, NULL, 0, 0, 0, 0, SWP_NOZORDER OR SWP_NOMOVE OR SWP_NOSIZE OR SWP_DRAWFRAME

These repainting problems happen when there are controls that are children of another control instead of the dialog.
Title: Re: Tab control with DDT ?
Post by: docroger on August 05, 2025, 02:41:11 PM
Very good news !

I have tested the code (DDT with tab) and it work fine with latest version of afxnova.
My codes work also without any problems.

Cool !

I continue using DDT (simple for me) and test AFxNova.
Title: Re: Tab control with DDT ?
Post by: José Roca on August 05, 2025, 05:26:01 PM
But the code uses an hybrid approach. It uses CWindows, not dialogs, for the tab pages. I wanted to discover why I was having repainting problems when using dialogs. The main problem is that the Windows Dialog Engine is a black box (no source code available) and we don't know what exactly does under the hood. It would be possible to use dialogs for the tab pages, but having to duplicate everything for CWindow and CDialog is too much work.