First try to create an Object Inspector with xBrowse

First try to create an Object Inspector with xBrowse

Postby Otto » Mon Aug 18, 2008 7:38 am

Now I tried with the object inspector code form FIVETECH to
create an “ ObjectInspector” for Fivewin.

Regards,
Otto

Image



Code: Select all  Expand view  RUN
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 
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Mon Aug 18, 2008 1: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Mon Aug 18, 2008 2:42 pm

Otto,

Here you have a first prototype:
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Mon Aug 18, 2008 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests