Strange window problem

Windows specific forum
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Strange window problem

Post by PB&J Lover »

I have a main parent window and 2 children (windows). If I close window 2 and open 3, it takes the form of window 2 (in size only).

If I keep window 2 open and open window 3 it does not take the form of window 2 and opens properly.

Also, I am changing the color of a listicongadget on window 2. When I open and close window 2 a textgadet and stringgadget alternately get colored as I open and close the window.

What's going on with my children? :D

Thanks.
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

can u give an example of the code producing this problem?
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

window problem

Post by PB&J Lover »

Well I'm not sure what code is doing it. Here's the callback:

Code: Select all

Procedure WindowCallback(WindowID,Message,wParam,lParam)
  ReturnValue = #PB_ProcessPureBasicEvents

  If Message = #WM_GETMINMAXINFO
    ReturnValue = PVDynamic_LockWindow(WindowID,lParam)
  EndIf
  
  If Message = #WM_SIZE
    ReturnValue = PVDynamic_Resize(WindowID)
  EndIf

  If Message = #WM_CTLCOLORSTATIC Or Message=#WM_CTLCOLOREDIT Or Message=#WM_CTLCOLORLISTBOX
    ReturnValue = PVDynamic_ColorGadget(lParam,wParam)
  EndIf

  ProcedureReturn ReturnValue
EndProcedure
I am using PureVision and when I turned off the Resizing feature the window problem went away. The coloring issue didn't though.

Any ideas :?:
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

let me get this right: in ure app, if u close window 2, then open window 3, window 3 resizes itself to window 2
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Post by PB&J Lover »

Yes, that is what happens. And, if I open window 3 and then close it and open and close window 2 the colors on some gadgets alternate.

Here's the window defs for both child windows:

Code: Select all

Procedure.l Window_pickboard()
  Window_pickboard=OpenWindow(#PB_Any,195,140,275,460,#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_Invisible,"Fractional Pickboard",WindowID(Window_Main))
  If Window_pickboard
    If CreateGadgetList(WindowID(Window_pickboard))
      Gadget_pickboard_data=ListIconGadget(#PB_Any,0,0,275,430,"  DEC",57,#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
        SendMessage_(GadgetID(Gadget_pickboard_data),#LVM_SETBKCOLOR,0,14024703)
        SendMessage_(GadgetID(Gadget_pickboard_data),#LVM_SETTEXTBKCOLOR,0,14024703)
        AddGadgetColumn(Gadget_pickboard_data,1,"1/8",37)
        AddGadgetColumn(Gadget_pickboard_data,2,"1/16",53)
        AddGadgetColumn(Gadget_pickboard_data,3,"1/32",53)
        AddGadgetColumn(Gadget_pickboard_data,4,"1/64",53)
        SetGadgetFont(Gadget_pickboard_data,UseFont(LoadFont(#PB_Any,"Courier New",10,256)))
      Gadget_pickboard_units=SpinGadget(#PB_Any,213,437,35,20,0,100)
      Gadget_pickboard_Text30=TextGadget(#PB_Any,171,440,40,15,"Units",#PB_Text_Center)
      PVDynamic_AddLockWindow(Window_pickboard,0,0,0)
      PVDynamic_AddGadget(Window_pickboard,Gadget_pickboard_data,1)
      PVDynamic_AddGadget(Window_pickboard,Gadget_pickboard_units,4)
      PVDynamic_AddGadget(Window_pickboard,Gadget_pickboard_Text30,4)
      HideWindow(Window_pickboard,0)
      ProcedureReturn WindowID()
    EndIf
  EndIf
EndProcedure


Procedure.l Window_options()
  Window_options=OpenWindow(#PB_Any,563,372,400,297,#PB_Window_SystemMenu|#PB_Window_WindowCentered|#PB_Window_Invisible,"Punch Finder Program Preferences",WindowID(Window_Main))
  If Window_options
    If CreateGadgetList(WindowID(Window_options))
      Gadget_options_OPT=PanelGadget(#PB_Any,0,0,400,260)
      AddGadgetItem(Gadget_options_OPT,-1,"General Settings")
      Gadget_options_gen_list=ListIconGadget(#PB_Any,0,5,395,230,"Program Variables",200,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
        AddGadgetColumn(Gadget_options_gen_list,1,"Values",190)
        GadgetToolTip(Gadget_options_gen_list,"Double Click on Option to change value.")
      AddGadgetItem(Gadget_options_OPT,-1,"Annotation")
      Gadget_options_annote_enter=StringGadget(#PB_Any,5,200,385,20,"")
      Gadget_options_annote_text=ListViewGadget(#PB_Any,0,0,395,185)
        PVDynamic_AddColorGadget(Gadget_options_annote_text,16777215,8421440)
        SetGadgetFont(Gadget_options_annote_text,UseFont(LoadFont(#PB_Any,"Arial",9,256)))
      AddGadgetItem(Gadget_options_OPT,-1,"Pickboard")
      Gadget_options_standard=StringGadget(#PB_Any,246,18,130,35,"Default",#PB_String_ReadOnly|#PB_Text_Center)
        PVDynamic_AddColorGadget(Gadget_options_standard,128,14024703)
        SetGadgetFont(Gadget_options_standard,UseFont(LoadFont(#PB_Any,"Arial",18,256)))
      Gadget_options_aqua=StringGadget(#PB_Any,246,58,130,35,"Aqua",#PB_String_ReadOnly|#PB_Text_Center)
        PVDynamic_AddColorGadget(Gadget_options_aqua,8404992,16448184)
        SetGadgetFont(Gadget_options_aqua,UseFont(LoadFont(#PB_Any,"Arial",18,256)))
      Gadget_options_packer=StringGadget(#PB_Any,246,98,130,35,"Packer",#PB_String_ReadOnly|#PB_Text_Center)
        PVDynamic_AddColorGadget(Gadget_options_packer,3302400,14024703)
        SetGadgetFont(Gadget_options_packer,UseFont(LoadFont(#PB_Any,"Arial",18,256)))
      Gadget_options_antique=StringGadget(#PB_Any,246,138,130,35,"Antique",#PB_String_ReadOnly|#PB_Text_Center)
        PVDynamic_AddColorGadget(Gadget_options_antique,128,14803425)
        SetGadgetFont(Gadget_options_antique,UseFont(LoadFont(#PB_Any,"Arial",18,256)))
      Gadget_options_plain=StringGadget(#PB_Any,246,178,130,35,"Plain",#PB_String_ReadOnly|#PB_Text_Center)
        PVDynamic_AddColorGadget(Gadget_options_plain,0,16777215)
        SetGadgetFont(Gadget_options_plain,UseFont(LoadFont(#PB_Any,"Arial",18,256)))
      Gadget_options_def=OptionGadget(#PB_Any,226,28,15,20,"")
      Gadget_options_aqu=OptionGadget(#PB_Any,226,68,15,20,"")
      Gadget_options_pac=OptionGadget(#PB_Any,226,108,15,20,"")
      Gadget_options_ant=OptionGadget(#PB_Any,226,148,15,20,"")
      Gadget_options_pla=OptionGadget(#PB_Any,226,188,15,20,"")
      Gadget_options_colors=Frame3DGadget(#PB_Any,215,10,170,215,"",#PB_Frame3D_Double)
      Gadget_options_pick_list=ListIconGadget(#PB_Any,5,10,200,215,"Options",195,#PB_ListIcon_CheckBoxes|#PB_ListIcon_MultiSelect|#PB_ListIcon_GridLines)
        GadgetToolTip(Gadget_options_pick_list,"Check Box to Select Option.")
      CloseGadgetList()
      Gadget_options_save=ButtonGadget(#PB_Any,5,270,60,20,"SAVE",#PB_Button_Default|$8000)
      Gadget_options_exit=ButtonGadget(#PB_Any,70,270,60,20,"EXIT",$8000)
      HideWindow(Window_options,0)
      ProcedureReturn WindowID()
    EndIf
  EndIf
EndProcedure
The call back is posted above in a previous post.
When I remove the sizing attributes all the problems go away. Except the coloring problem.

Does that help? :shock:
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

problem solved

Post by PB&J Lover »

The guys at PureVision told me the problem. I was using global variables for my window constants. I did this because I thought it would allow #PB_Any to avoid conflicts in case I had duplicate constants (which the compiler alerts you about anyway).

This ended up causing me more problems than it "solved" so I've gone back to using just constants (for the most part).

Thanks everyone. PB rules!!!!! :D
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Post Reply