@broadblues
I am compiling the source, and i am tracking a bug that prevent the gui to appear.
That bug is in CProfGUI.c
Here is the OpenCPWindow()function
PRIVATE int OpenCPWindow( void )
{
struct NewGadget ng;
struct Gadget *g;
UWORD lc, tc;
UWORD wleft = CPLeft, wtop = CPTop, ww, wh;
UWORD zCoords[] = { 200, 0, 300, 25 };
ComputeFont( Scr, Font, &CFont, CPWidth, CPHeight );
ww = ComputeX( CFont.FontX, CPWidth );
wh = ComputeY( CFont.FontY, CPHeight );
wleft = (Scr->Width - ww) / 2;
wtop = (Scr->Height - wh) / 2;
if (!(CPFont = OpenDiskFont( Font ))) // == NULL)
return( -5 );
if (!(g = CreateContext( &CPGList ))) // == NULL)
return( -1 );
for (lc = 0, tc = 0; lc < CP_CNT; lc++)
{
CopyMem( (char *) &CPNGad[ lc ], (char *) &ng,
(long) sizeof( struct NewGadget )
);
ng.ng_VisualInfo = VisualInfo;
ng.ng_TextAttr = Font;
ng.ng_LeftEdge = CFont.OffX + ComputeX( CFont.FontX,
ng.ng_LeftEdge
);
ng.ng_TopEdge = CFont.OffY + ComputeY( CFont.FontY,
ng.ng_TopEdge
);
ng.ng_Width = ComputeX( CFont.FontX, ng.ng_Width );
ng.ng_Height = ComputeY( CFont.FontY, ng.ng_Height);
CPGadgets[ lc ] = g
= CreateGadgetA( (ULONG) CPGTypes[ lc ],
g,
&ng,
(struct TagItem *) &CPGTags[ tc ] );
while (CPGTags[ tc ] != TAG_DONE)
tc += 2;
tc++;
if (!g) // == NULL)
return( -2 );
}
if (!(CPMenus = CreateMenus( CPNewMenu, GTMN_FrontPen, 0L, TAG_DONE ))) // == NULL)
return( -3 );
LayoutMenus( CPMenus, VisualInfo, TAG_DONE );
if (!(CPWnd = OpenWindowTags( NULL,
WA_Left, wleft,
WA_Top, wtop,
WA_Width, ww + CFont.OffX + Scr->WBorRight,
WA_Height, wh + CFont.OffY + Scr->WBorBottom,
WA_IDCMP, CHECKBOXIDCMP | BUTTONIDCMP
| LISTVIEWIDCMP | STRINGIDCMP | INTEGERIDCMP
| IDCMP_CLOSEWINDOW | IDCMP_VANILLAKEY | IDCMP_RAWKEY
| IDCMP_REFRESHWINDOW | IDCMP_MENUPICK,
WA_Flags, WFLG_DRAGBAR | WFLG_DEPTHGADGET
| WFLG_CLOSEGADGET | WFLG_SMART_REFRESH | WFLG_HASZOOM
| WFLG_ACTIVATE,
WA_Zoom, (ULONG) &zCoords[0],
WA_Gadgets, CPGList,
WA_Title, CPWdt,
WA_ScreenTitle, ScrTitle,
WA_CustomScreen, Scr,
TAG_DONE )))
{
return( -4 );
}
SetMenuStrip( CPWnd, CPMenus );
GT_RefreshWindow( CPWnd, NULL );
CPRender();
return( 0 );
}
The gadgets are created using
PRIVATE ULONG CPGTags[] = {
(TAG_DONE), (TAG_DONE), (TAG_DONE),
(TAG_DONE), (TAG_DONE), (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
GTLV_ShowSelected, 0L, (LAYOUTA_Spacing), 3,
GTLV_Selected, TRUE, (TAG_DONE),
(GA_TabCycle), FALSE, (GTST_MaxChars), BUFF_SIZE, // Anonymous Str gadget
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE), // BuildFuncs button
(GA_TabCycle), FALSE, (GTST_MaxChars), BUFF_SIZE, // Output filename
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GA_TabCycle), FALSE, (GTST_MaxChars), 256, // Function Str
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GTIN_Number), 66, (GTIN_MaxChars), 4, // Length integer
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GTIN_Number), 80, (GTIN_MaxChars), 4, // Width integer
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GTIN_Number), 5, (GTIN_MaxChars), 4, // Right Margin
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GTIN_Number), 5, (GTIN_MaxChars), 4, // Left Margin
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE), // Make Profile
(GT_Underscore), '_', (TAG_DONE), // Load Filelist
// (GA_TabCycle), FALSE, (GTST_MaxChars), 256, // Function Name
// (STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
// (GT_Underscore), '_', (TAG_DONE), // Edit Function
}
PRIVATE UWORD CPGTypes[] = {
CHECKBOX_KIND, CHECKBOX_KIND, CHECKBOX_KIND, // CheckBox Gadgets
CHECKBOX_KIND, CHECKBOX_KIND, CHECKBOX_KIND,
BUTTON_KIND, BUTTON_KIND, LISTVIEW_KIND, // BuildFuncs gadgets.
STRING_KIND, BUTTON_KIND,
STRING_KIND, STRING_KIND, INTEGER_KIND, // CProfiler gadgets.
INTEGER_KIND, INTEGER_KIND, INTEGER_KIND,
BUTTON_KIND, BUTTON_KIND,
// STRING_KIND, BUTTON_KIND, // GetF gadgets.
}
and
PRIVATE struct NewGadget CPNGad[] = {
// Re-adjust following gadgets TopEdge by 34 if EditFuncs are uncommented.
147, 358, 26, 11, (STRPTR) "page length", NULL, ID_PageLength,
PLACETEXT_LEFT, NULL, (APTR) PageLengthClicked,
147, 381, 26, 11, (STRPTR) "page width", NULL, ID_PageWidth,
PLACETEXT_LEFT, NULL, (APTR) PageWidthClicked,
147, 404, 26, 11, (STRPTR) "right margin", NULL, ID_RightMargin,
PLACETEXT_LEFT, NULL, (APTR) RightMarginClicked,
147, 427, 26, 11, (STRPTR) "left margin", NULL, ID_LeftMargin,
PLACETEXT_LEFT, NULL, (APTR) LeftMarginClicked,
147, 454, 26, 11, (STRPTR) "statistics only", NULL, ID_StatsOnly,
PLACETEXT_LEFT, NULL, (APTR) StatsOnlyClicked,
147, 329, 26, 11, (STRPTR) "target function", NULL, ID_TargetFunction,
PLACETEXT_LEFT, NULL, (APTR) TargetFunctionClicked,
17, 26, 101, 20, (STRPTR) "_Add File", NULL, ID_AddFile,
PLACETEXT_IN, NULL, (APTR) AddFileClicked,
17, 54, 101, 20, (STRPTR) "_Delete File", NULL, ID_DeleteFile,
PLACETEXT_IN, NULL, (APTR) DeleteFileClicked,
122, 26, 495, 185, (STRPTR) "Source Files:", NULL, ID_FilesLV,
PLACETEXT_ABOVE|NG_HIGHLABEL, NULL, (APTR) FilesLVClicked,
122, 207, 495, 20, NULL, NULL, ID_FileNameStr,
0, NULL, (APTR) FileNameStrClicked,
264, 232, 139, 20, (STRPTR) "_Build Functions!", NULL, ID_Build_Funcs,
PLACETEXT_IN, NULL, (APTR) BuildFuncsClicked,
263, 305, 355, 20, (STRPTR) "Output Name:", NULL, ID_OutFileStr,
PLACETEXT_LEFT, NULL, (APTR) OutFileStrClicked,
263, 329, 355, 20, (STRPTR) "Function:", NULL, ID_FunctionStr,
PLACETEXT_LEFT, NULL, (APTR) FunctionStrClicked,
263, 358, 47, 20, (STRPTR) "Length:", NULL, ID_LengthInt,
PLACETEXT_LEFT, NULL, (APTR) LengthIntClicked,
263, 381, 47, 20, (STRPTR) "Width:", NULL, ID_WidthInt,
PLACETEXT_LEFT, NULL, (APTR) WidthIntClicked,
263, 404, 47, 20, (STRPTR) "Right:", NULL, ID_RightInt,
PLACETEXT_LEFT, NULL, (APTR) RightIntClicked,
263, 427, 47, 20, (STRPTR) "Left:", NULL, ID_LeftInt,
PLACETEXT_LEFT, NULL, (APTR) LeftIntClicked,
415, 360, 118, 20, (STRPTR) "Make _Profile!", NULL, ID_MakeProfile,
PLACETEXT_IN, NULL, (APTR) MakeProfileClicked,
// 04/28/99 Added Load FileList gadget:
122, 232, 133, 20, (STRPTR) "_Load FileList!", NULL, ID_LoadListFile,
PLACETEXT_IN, NULL, (APTR) LoadListFileClicked,
/*
260, 263, 355, 20, (STRPTR) "Function Name:", NULL, ID_EditFuncNameStr,
PLACETEXT_LEFT, NULL, (APTR) EditFuncNameStrClicked,
10, 263, 127, 20, (STRPTR) "_Edit Function!", NULL, ID_EditFuncs,
PLACETEXT_IN, NULL, (APTR) EditFuncsClicked,
Re-adjust Output Name thru MakeProfile gadgets TopEdge by 34 if these are uncommented.
*/
};
I did verify that lc never gets higher than 9 in the for loop
.
If i limit the gadgets CP_CNT initally set to 19, to rhe value of 9 the gui appears.
So i first suspected the 1st string gadget to cause the problem
then i deleted that gadget (commenting out the corresponding lines in the 3 arrays shown, ) and lowering the CP_CNT
The probllem was not gone, i then eliminated all string gadgets, no better result.
And always lc was 9 or 8 in order to have the window opened.
Then the CreateGadgetA failed and
if (!g) // == NULL)
return( -2 );
}
was entered
I am out of ideas what else to try.
btw there were more files lacking, so the archives mentioned previously are both incomplete.
This should contain them all
http://users.online.be/AD/ProfilerPPC-src3.lha ( i am using other makefile and manipulated sources and headers to be able to compile though)