NC Clone

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

NC Clone

Post by AUGE_OHR »

hi,

do you remember Norton Commander :?:

my next harbour Project is this.
hb_xcm.jpg
hb_xcm.jpg (179.08 KiB) Viewed 6388 times
but i have some Design Problem :

i use a Splitbox to hold TAB with GRID. both TAB / GRID are same Size but when re-Size there is "Place" on right side :o
Splitbox do assign on "Top" or "Bottom" but i want to have it in "Mid" so i have to use a PANEL.

with this Combination i have Problem with STATUSBAR where you just see TIME() but when maximize you see hole STATUSBAR ... :roll:

Code: Select all

      DEFINE STATUSBAR PARENT Win_1                                   // FONT "Arial" SIZE 9
         STATUSITEM "Hello" WIDTH nWidth-200
         DATE               WIDTH 100
         CLOCK              WIDTH 100
      END STATUSBAR
so what is the Problem with STATUSBAR :idea:

---

i have begin with *.FMG and used that (modify) Code in PRG.
now i want to ADD more TAB with GRID but how to do it with this Syntax :?:

the Question is about Variable like Tab_1 or Grid_1 where i need "Macro" ... or using OOP :idea:

Code: Select all

   DEFINE TAB Tab_1 ;
      ...
      DEFINE PAGE "Page 1"
         DEFINE GRID Grid_1
            ...
         END GRID
      END PAGE
   END TAB
can someone point me to a Demo Sample or show me a Code Snip how to ADD more TAB / GRID with "Macro".
need some help please, thx
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

hi,

i have a Problem to update a "virtual" GRID

Code: Select all

PRIVATE aDir2 := DIRECTORY("*.*", "D")
   DEFINE WINDOW Win_1 ;
      MAIN ;
      ON INIT FillGrid()

   DEFINE GRID Grid_1
      VIRTUAL .T.
      ONQUERYDATA this.querydata := aDir2[this.queryrowindex,this.querycolindex]
      ITEMCOUNT LEN(aDir2)
now i change aDir2 in "ON INIT"

Code: Select all

PROCEDURE FillGrid()
   aDir2 := DIRECTORY("C:\TEMP\*.*", "D")                   // change PRIVATE aDir2 
   aDir2 := GridSortDir(aDir2)
   WinRight.Grid_1.DeleteAllItems()
   SetProperty("WinRight","Grid_1","ITEMCOUNT", LEN(aDir2))
   WinRight.Grid_1.Refresh()
FillGrid() have change data in GRID but fail when i try same later, why :o

Code: Select all

PROCEDURE DoIt(nDir,cForm,cObj)
   ...  
   aDir := DIRECTORY(cNewPath+"*.*", "D")
WinRight.Grid_1.hide()
   aDir2 := ACLONE(aDir)                   // aDir2 PRIVATE
   WinRight.Grid_1.DeleteAllItems()
   SetProperty("WinRight","Grid_1","ITEMCOUNT", LEN(aDir2))
   WinRight.Grid_1.Refresh()
WinRight.Grid_1.Show()
   DO EVENTS
it is the same Code and i "force repaint" when using o:hide() / o:show() but it still does not change :cry:
who can tell me what i'm doing wrong or miss with "virtual" GRID :idea:

p.s. i do not want use ADDItem() with each Element
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

hi,

got it working so far
here first Version of HBFM which show some Problem.
HBFM001.zip
(1.26 MiB) Downloaded 267 times
STATUSBAR : you see just TIME() but when maximize you see hole Statusbar.
SPLITBOX : it seem there ist "no End" on right side.
in c:\hmg.3.4.4\SOURCE\h_EventCB.prg i found something about SplitBox.

Code: Select all

Function GetSplitChildWindowHandle (cFormName, cParentForm)
Function GetSplitBoxHandle (cParentForm)
Function GetSplitBoxRect (cParentForm)
Function GetSplitBoxWIDTH (cParentForm)
Function GetSplitBoxHEIGHT (cParentForm)
i saw a lot of GET but no SET (when re-size) for SPLITBOX :?: are there any :idea:

Splitbox Child Window : how make it "not close" by User :idea:

---

what i want are "multiple" TAB with GRID

i have read about
- AddPage ( nPageNumber , cCaption [ , cImageName ] )
- DeletePage ( nPageNumber )
- AddControl ( ControlName , nPagenumber , nRow , nCol )
is that the Way as i found no Sample :?:


i have begin to use a Array to identify left/right/path and more Information using
ThisWindow.Name -> Split Window Name
This.Name -> GRID Name
This.Value -> Position in GRID
---
ON INIT i try to set Focus to GRID but it does not work ... Splitbox :?:

Code: Select all

   WinLeft.Setfocus()
*   WinLeft.Tab_1(1).Setfocus() -> crash
   WinLeft.Tab_1(1).Grid_1.Setfocus()
---

missing ICON :

as i use a "virtual" GRID Icon must use ImageList() filled by SHGetFileInfoA() API Function
who can point me to a Sample to use Icon that Way with GRID

there is a

Code: Select all

//        BT_DirectoryInfo ( [nCSIDL | cPath] , [nTypeList] , @nIndexRoot, @CSIDL_Name ) --> { { Data1, Data2, Data3, ... } , ... }
HB_FUNC ( BT_DIRECTORYINFO )
but also no Sample how to use it to fill a Imagelist for GRID

i wonder that those Function / Method are available but not Documented and no Sample :cry:
please help me with my Question, thx
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

hi,

have search for "GetVolumeInformation" and found c:\MiniGUI\SAMPLES\Advanced\FileMan\ :D

so work is done ... but i want my "own" Version.
but now i have a Source where i can look and those HB_FUNC from MiniGUI can also used in HMG
so my Version will be a HMG Version ...
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

hi,

i try to CLICK FileMan.prg but it fail with this Syntax

Code: Select all

   COMBOBOX Combo_1
there is no @ x,y and no DEFINE / ENDCOMBOBOX :shock:

but it compile / run with build.bat ... hm

i don't understand that ... can someone enlighten me please
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

hi,

as i say i found a Sample in MiniGUI. it also use SPLITBOX but it does not work fine ...
same Direction now my Question : BACKCOLOR of SPLITCHILD ?

Code: Select all

   DEFINE WINDOW Win_1 ;
              MAIN ;        
              BACKCOLOR {056,056,056} ;
              ...
              
      DEFINE WINDOW Win_Mid ;
              AT 70, 0 ;
              WIDTH nWidth HEIGHT nHeight - 080 ;
              TITLE '' ;
              BACKCOLOR {056,056,056} ;
              PANEL

         DEFINE SPLITBOX

            DEFINE WINDOW WinLeft ;
                    WIDTH 630 HEIGHT 890 - 080 ;
                    TITLE ""   ;
                    SPLITCHILD ;
                    FOCUSED ;
                    NOCAPTION ;
                    BACKCOLOR {056,056,056} <- CRASH
when i try set BACKCOLOR in SPLITCHILD it crash ... so how to set Background-Color :?:
BackColor.jpg
BackColor.jpg (294.75 KiB) Viewed 6286 times
you can see the SPLITBAR which height is limited from Win_Mid which is a PANEL
Combobox are AT 0,0 on WinLeft / WinRight and these Area i like to have "Dark"

who have a Idea to get Color into these Area :idea:
have fun
Jimmy
Pcmodula
Posts: 34
Joined: Thu Nov 22, 2012 6:00 pm

Re: NC Clone

Post by Pcmodula »

Hi Jimmy,
do you want reinvent the wheel?
[image]
FileManager.png
FileManager.png (85.94 KiB) Viewed 6264 times
[/image]
This project is present in Minigui Extended edition at least since 2012.
See \Minigui\SAMPLES\Advanced\FileMan
But if you want to improve it, have fun!

Pcmodula
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: NC Clone

Post by AUGE_OHR »

Pcmodula wrote: Tue Jan 21, 2020 6:27 am do you want reinvent the wheel?
this is the Sample i found when search for "GetVolumeInformation" in c:\MiniGUI\SAMPLES\Advanced\FileMan\

it is easy to use existing Code and modify it but i want to learn how it work.

1.) use a VIRTUAL GRID and change Array "on-fly" when change Directory (working)
2.) resize on PC an Table PC ( Landscape / Portrait )
3.) integrate own OSK
4.) Dark-Mode
HBFM_002.jpg
HBFM_002.jpg (295.8 KiB) Viewed 6245 times
---

i notice that MiniGUI Sample does not maximize, so the Work was (again) to write Code for ON SIZE / ON MAXIMIZE

i have try to use SPLITBOX but it is not what i use as CLASS under Xbase++ ... it is a ReBar :o
those things i have to learn and that why i try to "re-engine" my Xbase++ Code under harbour / HMG

Source for c:\MiniGUI\SAMPLES\Advanced\FileMan\ is a BIG help.
i have try to use TAB to switch left/right but i put my Code on wrong place (ONKEY of GRID)

i have to put it into MAIN Windows to override "other" (e.g. TabPage which TABSTOP .T.)

Code: Select all

ON KEY TAB ACTION IF( nGridFocus = 2,;
   Domethod( "WinLeft", "Grid_1", "SetFocus" ),;
   Domethod( "WinRight", "Grid_1", "SetFocus" )  )
---

until this point it was easy but now i have to change Code using Macro while i want to use "many" TAB each with GRID.
while i have left/right i can copy/move files (F5 / F6) but what about DragDrop from left to right :?:

it is no "real" DragDrop while it is within App and i have it in my Xbase++ App.
not sure how to "translate" this Technique to harbour / HMG

Code: Select all

PROCEDURE ShowDragDrop( oObj, nNo )
   // all Mouse Event are "capture" in This Loop until release
   oObj:captureMouse( .T. )
   nEvent := xbeM_Motion

   DO WHILE lDragDrop = .T.
      nEvent := APPEVENT( @mp1, @mp2, @oXbp, 100 )

      DO CASE
         CASE nEvent == xbe_None
            iii ++
            IF iii > 10
               MSGBOX( "timeout" )
               EXIT
            ENDIF
         CASE nEvent == xbeM_Motion
           // can be a Animation
         CASE nEvent == xbeM_RbDown
            PostAppEvent( xbeM_Motion )
         CASE nEvent == xbeP_Keyboard .AND. mp1 == xbeK_ESC
            EXIT
         CASE nEvent == xbeM_LbDblClick
            EXIT
         CASE nEvent == xbeM_LbDown
            EXIT

          // Action when LbUp 
          CASE nEvent == xbeM_LbUp
          
            aDropPos := GetCursorPos()
            nHwnd := WindowFromPoint( aDropPos )
            cClsName := ChrR( 0, 1024 )
            cText := ChrR( 0, 1024 )
            @ user32:GetWindowTextA( nHwnd, @cText, LEN( cText ) )
            @ user32:GetClassNameA( nHwnd, @cClsName, LEN( cClsName ) )
            cClsName := STRTRAN( cClsName, CHR( 0 ), "" )
            cText := STRTRAN( cText, CHR( 0 ), "" )

            IF "SysListView32" $ cClsName .AND. "FolderView" $ cText
               PostappEvent( xbeE_CopyToDeskTop,,, LastDialog( oObj ) :drawingArea )
            ELSE
               oObj:Prep4Drag( nNo )
            ENDIF
            EXIT

         OTHERWISE
            oXbp:handleEvent( nEvent, mp1, mp2 )
      ENDCASE
   ENDDO
   // release "capture" of Mouse Event
   oObj:captureMouse( .F. )
who can point me to a Sample which "capture" Mouse Events :?:
have fun
Jimmy
Pcmodula
Posts: 34
Joined: Thu Nov 22, 2012 6:00 pm

Re: NC Clone

Post by Pcmodula »

AAAA! Ok I agree with you (Not for Dark Mode, i dont' like it, but if you add a "non dark setup utility"...)

Regards
Pcmodula
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: NC Clone

Post by serge_girard »

Pcmodula wrote:
21 Jan 2020, 07:27
do you want reinvent the wheel?
If the wheel gets better, why not?

Serge
There's nothing you can do that can't be done...
Post Reply