Help : Pelles C Resource Editor and FWH

Help : Pelles C Resource Editor and FWH

Postby anserkk » Wed Feb 04, 2009 8:14 am

Hi all,

I am just trying Pelles C to be used as a resource Editor along with FWH. When compared with ResEd, I found that Pelles C resource editor has some additional features in Aligning controls, based on a Group (Ctrl + Mouse Click).

I have a GET, SAY, GROUP, OkButton and CancelButton on the Dialog. Unfortunately the Say and Get inside the group is not getting displayed. The Get Object will appear without a border Only when I type something on the Keyboard.

Initial screen. GET and SAY is not displayed
Image

When I type something on the Keyboard, get appears without a border
Image

This is my TestRc.Prg

Code: Select all  Expand view
#Include "FiveWin.Ch"
*---------------------------------*
Function Main()
*---------------------------------*
Local oDlg,oSay,oGet,oBtnOk,oBtnCancel,cName,oGrp
cName:=space(30)
DEFINE DIALOG oDlg RESOURCE "AnsTest"

// If I don't give Color nRgb, I get a Redefine un time error
REDEFINE GROUP oGrp ID 4003 Prompt "Test"  color nRgb(0,0,0),nRgb(220,200,200)
REDEFINE SAY oSay ID 4001
REDEFINE GET oGet VAR cName ID 4002 
REDEFINE BUTTON oBtnOk ID IDOK

// If I don't give an Action then I will not be able to close the Dialog using the X button on the Dialog
// I wonder why it is so
REDEFINE BUTTON oBtnCancel ID IDCANCEL ACTION oDlg:End()

ACTIVATE DIALOG oDlg ON INIT oGet:SetFocus()
Return NIL


My .RC file TestRc.Rc
Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 5.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

ANSTEST DIALOGEX DISCARDABLE 6, 18, 342, 170
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
CAPTION "This is a test window"
FONT 8, "MS Shell Dlg", 0, 0, 1
{
  CONTROL "", 4002, "Edit", WS_BORDER|WS_TABSTOP, 96, 68, 188, 12
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 24, 132, 45, 15
  CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 84, 132, 45, 15
  CONTROL "Name", 4001, "Static", WS_GROUP, 44, 72, 40, 8
  CONTROL "Customer Details", 4003, "Button", BS_GROUPBOX|BS_NOTIFY, 28, 28, 264, 84
}


Other things which surprised me is that
1) In the PRG when I redefine the GROUP, If I don't specify COLOR then I get a Redefine RunTime Error
2) If I dont specify an ACTION clause in the button, then I will not be able to close the DIALOG using the X button on the Title bar of the Dialog.

I find many seniors like Mr.Otto and others are using Pelles C resource Editor and would like to know whether this is a standard behavior of Pelles C resource editor or Am I wrong somewhere ?.

Any useful tips for the usage of Pelles C along with FWH ?

I could not find an option like "Send to Back", "Bring to front" to solve the problem of GET and SAY controls not getting displayed inside the GROUP.

I am looking for a Good Free Resource Editor which works well with FWH. I have also tested ResEd, it is also equally good except for the Aligning of the controls and the ID no. generation part

Any help ?

Regards

Anser
Last edited by anserkk on Wed Feb 04, 2009 12:00 pm, edited 2 times in total.
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby StefanHaupt » Wed Feb 04, 2009 9:19 am

Anser,

I´m using PellesC for a long time and I never noticed such a behavior.

If you use a colored groupbox maybe the order in the rc is important, try to put the groupbox definiton on the first place before the other controls are defined. Just an idea...
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Wed Feb 04, 2009 10:00 am

Dear Mr.Stefan,

try to put the groupbox definiton on the first place before the other controls are defined. Just an idea...

Yes, I have Redefined Group as the first control in my PRG. If you check my PRG posted above you will find it.

Or is there anything in the configurations that I have to change in Pelles C. I have followed a default installation

In the above given code if I comment out the ACTION associated with the BUTTON ie
Code: Select all  Expand view
REDEFINE BUTTON oBtnCancel ID IDCANCEL // ACTION oDlg:End()

then I am not able to close the DIALOG. The only option is CTRL+ALT+DEL

I wish somebody had a sample .RC file generated with Pelles C, and a PRG showing the redefine FWH codes ? Especially a Group control.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Wed Feb 04, 2009 11:45 am

FYI,

I found that when I click on the X (close) button on the the Title Bar, the action associated with the CANCEL Button is getting executed. This means that if I don't give ACTION oDlg:End() on the Cancel Button then I will have to use Ctrl+Alt+Del to terminate the Dialog.

Solution :

Do not use IDCANCEL button which gets created automatically when we create the Dialog using Pelles C.
OR
Change the Buttons ID from IDCANCEL to any other no. For Eg.1009 etc.

Now I need to find a solution to the GROUP problem. Anybody any hint ?

Do anybody have a sample .RC file containing all possible FWH controls on a DIALOG and a PRG showing how it is REDEFINED in the PRG ?

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Wed Feb 04, 2009 11:55 am

Dear Mr.Stefan,

try to put the groupbox definiton on the first place before the other controls are defined. Just an idea...

You are right. This should be done in the .RC file and not in the PRG. I misunderstood this for REDEFINE in the PRG.

So both the problems described above is solved :D

Now another problem is with the BITMAP. BITMAP is not getting displayed

.PRG
Code: Select all  Expand view
REDEFINE BITMAP oBmp ID 4004 of oDlg RESOURCE "Accept32x32" NOBORDER

.RC
Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 5.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "TestRc.h"

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

ANSTEST DIALOGEX DISCARDABLE 6, 18, 342, 170
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
CAPTION "This is a test window"
FONT 8, "MS Shell Dlg", 0, 0, 1
{
  CONTROL "Customer Details", 4003, "Button", BS_GROUPBOX|BS_NOTIFY, 28, 28, 264, 84
  CONTROL "", 4002, "Edit", WS_BORDER|WS_TABSTOP, 96, 68, 188, 12
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 24, 132, 45, 15
  CONTROL "Cancel", 1009, "Button", WS_TABSTOP, 84, 132, 45, 15
  CONTROL "Name", 4001, "Static", WS_GROUP, 44, 72, 40, 8
  CONTROL "", 4004, "Static", SS_BITMAP|SS_CENTERIMAGE|WS_BORDER, 232, 116, 48, 40
}

Accept32x32 BITMAP "Chain.Bmp"


Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Thu Feb 05, 2009 6:30 am

Can anynody show me a .RC definition to create an xBrowse using Pelles C Resource Editor. I have used the user control option but it is not working

.RC
Code: Select all  Expand view
CONTROL "Custom control", 4005, "xBrowse", 0x00000000, 28, 124, 264, 52


Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Thu Feb 05, 2009 8:17 am

I got it. I don't know whether this is the right way or not.

After placing the Custom control on the dialog,
a) save the Project (Resource)
b) Open the .RC file with note pad or any text editor and manually change

this
CONTROL "Custom control", 4005, "TxBrowse", 0x00000000, 28, 124, 264, 52

to
CONTROL "", 4005, "TxBrowse", WS_TABSTOP|0x00800000, 28, 124, 264, 120

I don't know what is this 0x00800000

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Help : Pelles C Resource Editor and FWH

Postby StefanHaupt » Thu Feb 05, 2009 8:53 am

Anser,

0x00800000 means WS_BORDER
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Help : Pelles C Resource Editor and FWH

Postby anserkk » Thu Feb 05, 2009 8:59 am

Mr.Stefan,

Thankyou for the information

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests