Make a dialog MDI or at least stay on screen

Make a dialog MDI or at least stay on screen

Postby Marc Venken » Tue Jun 27, 2023 9:15 pm

I have a Xbrowse that calls a dialog to select pictures from.

Eanfotoselect and the parameter is a part of the jpg file

Code: Select all  Expand view  RUN

         WITH OBJECT :Cover
           :nEditType     := EDIT_GET_BUTTON
           :bStrImage     := { || getorgfoto(webshop->orgfoto) }
           :bEditBlock    := { |r,c,oCol| EanfotoSelect( oCol:Value ) }
           :oDataFont     := oFontXS
           :nDataStrAlign := AL_CENTER + AL_BOTTOM
           :nDataBmpAlign := AL_CENTER
         END
 


When I hit the button the function is called and I can select the picture that I want. I have to close this dialog to go back to the first xbrowse, select a second field and do the process all over
The function is called, filters are set again, I select, need to close the dialog and keep going on...

I would like that the function eanfotoselect is called onces and stay on the screen. select a picture from it and return to the first browse while this lookup dialog stays on screen. Go to a other field in the first browse and select direct from the onscreen dialog and keep doing this until I close the dialog.

Code: Select all  Expand view  RUN

static function eanfotoSelect( nCode )

   local nSelect
   local oDlg, oBrwF, oFont
   local lNewZoek := .F.
   aDir := DIRECTORY( "D:\PICTURES\TOEVOEGEN\TODO\*.JPG" )
   AEval( aDir, { |a| a[ 2 ] := "D:\PICTURES\TOEVOEGEN\TODO\" + a[ 1 ] } )

   DEFINE FONT oFont NAME "
TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 1300,800 PIXEL FONT oFont TITLE "
Bestand met alle foto's"

   @ 10,320 XBROWSE oBrwL SIZE 300,-70 PIXEL OF oDlg ;
      DATASOURCE aDir;
      COLUMNS 1, 2;
      COLSIZES 450,100 ;
      CELL LINES NOBORDER AUTOSORT

   WITH OBJECT oBrwL
      :bLDblClick    := { || nSelect := oBrwL:oCol(1):value, oDlg:End() }
      :bKeyChar      := { |nKey| If( nKey == VK_RETURN, ;
               ( nSelect := oBrwL:oCol(1):value, oDlg:End() ), nil ) }
   END

   filterdata(nCode)
   oBrwL:nRowHeight:= 100
   oBrwL:aCols[ 2 ]:cDatatype := "F"
   oBrwL:aCols[ 2 ]:nDataBmpAlign    := AL_CENTER

   oBrwL:CreateFromCode()

   ACTIVATE DIALOG oDlg AS MDICHILD CENTERED
   RELEASE FONT oFont
return nSelect

Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1437
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Make a dialog MDI or at least stay on screen

Postby Antonio Linares » Wed Jun 28, 2023 11:12 am

Dear Marc,

Use a MDICHILD window, don't use a dialog
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests