FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour First try to create an Object Inspector with xBrowse
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

First try to create an Object Inspector with xBrowse

Posted: Mon Aug 18, 2008 07:38 AM
Now I tried with the object inspector code form FIVETECH to
create an “ ObjectInspector” for Fivewin.

Regards,
Otto





function objectInspector(cObjName,coWnd, nTop, nLeft, nBottom, nRight, cTitle, nStyle, oMenu, oBrush, oIcon,;
   oParent, lVScroll, lHScroll, nClrFore, nClrBack, oCursor, cBorder, lSysMenu,;
   lCaption, lMin, lMax, lPixel)

local oWndlocal, oBrw
local aData := { { "DEFINE WINDOW",   "<oWnd>",        EDIT_GET },;
   { "PIXEL" ,          "result",        EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "FROM Top",        "<nTop>",        EDIT_GET },;
   { "FROM Left",       "<nLeft>",       EDIT_GET },;
   { "FROM Bottom",     "<nBottom>",     EDIT_GET },;
   { "FROM Right",      "<nRight>" ,     EDIT_GET },;
   { "TITLE",           "<cTitle>",      EDIT_GET },;
   { "COLOR nClrFore",  "<nClrFore>",    EDIT_GET },;
   { "COLOR nClrBack",  "<nClrBack>",    EDIT_GET },;
   { "OF",              "<oParent>",     EDIT_GET },;
   { "BRUSH",           "<oBrush>",      EDIT_GET },;
   { "CURSOR",          "<oCursor>",     EDIT_GET },;
   { "ICON",            "<oIcon>",       EDIT_GET },;
   { "MENU",            "<oMenu>",       EDIT_GET },;
   { "STYLE",           "<nStyle>",      EDIT_GET },;
   { "BORDER",          "result",        EDIT_LISTBOX, {"NONE", "SINGLE"} },;
   { "NOSYSMENU",       "NO SYSMENU",    EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "NOCAPTION",       "NO CAPTION",    EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "NOICONIZE",       "NOMINIMIZE",    EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "NOZOOM",          "NOMAXIMIZE",    EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "VSCROLL",         "VERTICAL",      EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } },;
   { "HSCROLL",         "HORIZONTAL",    EDIT_BUTTON,  { || MsgYesNo( "Select a value" ) } } }

DEFAULT nTop     := 2, nLeft := 2, nBottom := 20, nRight := 70,;
   lVScroll := .f., lHScroll := .f.,;
   nClrFore := GetSysColor( COLOR_WINDOWTEXT ),;
   nClrBack := GetSysColor( COLOR_WINDOW ),;
   nStyle   := 0,;
   cBorder  := "SINGLE", lSysMenu := .t., lCaption := .t.,;
   lMin     := .t., lMax := .t., lPixel := .f., cTitle := "..." 

aData[1,2] := coWnd       
aData[2,2] := lPixel      
aData[3,2] := nTop        
aData[4,2] := nLeft       
aData[5,2] := nBottom     
aData[6,2] := nRight      
aData[7,2] := cTitle      
aData[8,2] :=  nClrFore   
aData[9,2] :=  nClrBack   
aData[10,2] := oParent    
aData[11,2] :=  oBrush    
aData[12,2] := oCursor    
aData[13,2] := oIcon      
aData[14,2] := oMenu      
aData[15,2] := nStyle     
aData[16,2] :=  cBorder   
aData[17,2] :=  lSysMenu  
aData[18,2] :=  lCaption  
aData[19,2] :=  lMin      
aData[20,2] :=  lMax      
aData[21,2] :=  lVScroll  
aData[22,2] :=  lHScroll
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

First try to create an Object Inspector with xBrowse

Posted: Mon Aug 18, 2008 12:32 PM

Otto,

Please do it using the Class TProperty, it simplifies your code and gives you much more power:

http://forums.fivetechsoft.com/viewtopi ... 1580#61580

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

First try to create an Object Inspector with xBrowse

Posted: Mon Aug 18, 2008 01:36 PM

Antonio,

In this case there is no object existing. I only have the properties.

The properties come from the source code editor.

That’s the trick.

I pass the source code (command syntax) to the harbour compiler and get back the properties of the object.

Then I edit the properties with the object inspector and pass back
Command syntax to the source code editor.

Regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

First try to create an Object Inspector with xBrowse

Posted: Mon Aug 18, 2008 02:42 PM
Otto,

Here you have a first prototype:
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

First try to create an Object Inspector with xBrowse

Posted: Mon Aug 18, 2008 02:45 PM

Here you have the source code and EXE:

http://rapidshare.com/files/138240022/otto.zip.html

In order to build it there, please add a new DATA nPosition to Class TWindow, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion