ColorView

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

ColorView

#1 Post by RDalzell »

Roger,

When attempting to compile your colorview example, it is missing the bdmslib.ch, which I assume is from Bobby, if he or you could share it would certainly be appreciated.

Thanks,
Rick

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ColorView

#2 Post by rdonnay »

Oops. Probably should have finished that sample.

I asked Bobby if I could include it in the eXpress++ samples, but I tried working on it today to unbundle it from his stuff and it's going to take awhile to figure it out.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: ColorView

#3 Post by Auge_Ohr »

XbpColorDialog() is include in v1.9.355 SL1 "XppUi2.lib" but not documented
try this

Code: Select all

#include "XBP.CH"
#include "APPEVENT.CH"
#include "GRA.CH"

#pragma library("XppUi2")

PROCEDURE APPSYS
RETURN

PROCEDURE Main
LOCAL nEvent, oXbp, mp1, mp2
LOCAL oDlg
LOCAL oColor
LOCAL aColor
LOCAL nColor
LOCAL nRGB1 := NIL
LOCAL nRGB2 := NIL
LOCAL oPushButton
LOCAL aSize := {400,300}
LOCAL aRGB  := {0,255,255}

   oDlg           := XbpDialog():new( ,, {0,0}, aSize  )
   oDlg:title     := "Dialog Farben Auswahl"
   oDlg:tasklist  := .t.
   oDlg:create()
   CenterControl(oDlg)

   oPushButton := XbpPushButton():new(oDlg:drawingArea,,;
                                  {100,50},{aSize[1]-200,aSize[2]-130} )
   oPushButton:caption := "Farben Auswahl"
   oPushButton:create()
   oPushButton:activate:= {|| nRGB1 := oColor:DISPLAY() }

   oColor := XbpColorDialog():New(oDlg:drawingArea)
//
// if use "User-define" Mode
//
*  oColor:mode := XBPCDLG_MODE_ALLOWCOLOREDIT
   oColor:mode := XBPCDLG_MODE_EDITCOLORS
*  oColor:mode := XBPCDLG_MODE_NOCOLOREDIT

   oColor:showHelp     := .F.           // Help Button
   oColor:displayAll    := .T.             // hm ...
   oColor:noDither      := .T.            // hm ...
   oColor:title := "Farbe Auswahl"
   oColor:center := .T.                   // zentriere auf Parent
//
// per-define Color. works only with define 16 Color
//
   oColor:defaultColor  := GraMakeRGBColor(aRGB)
//
   oColor:Create()

   SetAppWindow(oDlg)
   SetAppFocus(oDlg)
   SetAppFocus(oPushButton)

   nEvent := xbe_None
   DO WHILE nEvent != xbeP_Close
      nEvent := AppEvent ( @mp1, @mp2, @oXbp )
      //
      // just a workaround ?
      //
      IF nRGB2 <> nRGB1
         IF NIL <> nRGB1   // man muss prüfen ob der Wert "Sinn" macht
            aColor := GraGetRGBIntensity(nRGB1)
            IF NIL <> aColor
               nColor := GraMakeRGBColor(aColor)
               IF NIL <> nColor

// Result nColor 
                  oDlg:drawingArea:setColorBG(nColor)
// save new Color and update Display
                  oColor:defaultColor  := nColor
                  nRGB2 := nRGB1

               ENDIF
            ENDIF
         ENDIF
      ENDIF
      oXbp:HandleEvent ( nEvent, mp1, mp2 )
      IF nEvent == xbeP_Quit
         QUIT   // AppQuit()
      ENDIF
   ENDDO
   oColor:Destroy()
   oDlg:Destroy()
RETURN
greetings by OHR
Jimmy

Post Reply